Skip to content

Commit

Permalink
split + rewrite query language chapter to new HQL guide document
Browse files Browse the repository at this point in the history
  • Loading branch information
gavinking committed May 27, 2023
1 parent cf9e570 commit 4c8ed70
Show file tree
Hide file tree
Showing 34 changed files with 3,442 additions and 32 deletions.
51 changes: 51 additions & 0 deletions documentation/documentation.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,57 @@ tasks.register('renderIntroduction', AsciidoctorTask) {task->
}
}

tasks.register('renderQLPdf', AsciidoctorPdfTask) {task->
group = "Documentation"
description = 'Renders the Query Language document in PDF format using Asciidoctor.'
tasks.buildDocs.dependsOn task
tasks.buildDocsForPublishing.dependsOn task
inputs.property "hibernate-version", project.ormVersion

sourceDir = file( 'src/main/asciidoc/querylanguage' )
baseDir = file( 'src/main/asciidoc/querylanguage' )
sources {
include 'Hibernate_Query_Language.adoc'
}
outputDir = "$buildDir/asciidoc/querylanguage/pdf"

attributes jpaJavadocUrlPrefix: "https://javaee.github.io/javaee-spec/javadocs/javax/persistence/"
}

tasks.register('renderQL', AsciidoctorTask) {task->
group = "Documentation"
description = 'Renders the Query Language document in HTML format using Asciidoctor.'
tasks.buildDocs.dependsOn task
tasks.buildDocsForPublishing.dependsOn task
inputs.property "hibernate-version", project.ormVersion

sourceDir = file( 'src/main/asciidoc/querylanguage' )
sources {
include 'Hibernate_Query_Language.adoc'
}
outputDir = "$buildDir/asciidoc/querylanguage/html_single"

attributes linkcss: true,
stylesheet: "css/hibernate.css",
docinfo: 'private',
jpaJavadocUrlPrefix: "https://javaee.github.io/javaee-spec/javadocs/javax/persistence/"

resources {
from('src/main/asciidoc/querylanguage/') {
include 'images/**'
}
from('src/main/style/asciidoctor') {
include 'images/**'
}
from('src/main/style/asciidoctor') {
include 'css/**'
}
from('src/main/style/asciidoctor') {
include 'js/**'
}
}
}

// User Guide ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

tasks.register('renderUserGuide', AsciidoctorTask) { task ->
Expand Down
58 changes: 29 additions & 29 deletions documentation/src/main/asciidoc/introduction/Entities.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1425,63 +1425,63 @@ Let's pause to remember the annotations we've met so far.
|===
| Annotation | Purpose | JPA-standard

| `@Entity` | Declare an entity class | ✓
| `@MappedSuperclass` | Declare a non-entity class with mapped attributes inherited by an entity | ✓
| `@Embeddable` | Declare an embeddable type | ✓
| `@IdClass` | declare the identifier class for an entity with multiple `@Id` attributes | ✓
| `@Entity` | Declare an entity class | ✔
| `@MappedSuperclass` | Declare a non-entity class with mapped attributes inherited by an entity | ✔
| `@Embeddable` | Declare an embeddable type | ✔
| `@IdClass` | declare the identifier class for an entity with multiple `@Id` attributes | ✔
|===

.Declaring basic attributes
[%breakable,cols="22,~,^10,^13"]
|===
| Annotation | Purpose | | JPA-standard

| `@Id` | Declare a basic-typed identifier attribute | | ✓
| `@Version` | Declare a version attribute | | ✓
| `@Basic` | Declare a basic attribute | Default | ✓
| `@EmbeddedId` | Declare an embeddable-typed identifier attribute | | ✓
| `@Embedded` | Declare an embeddable-typed attribute | Inferred | ✓
| `@Enumerated` | Declare an `enum`-typed attribute and specify how it is encoded | Inferred | ✓
| `@Array` | Declare that an attribute maps to a SQL `ARRAY`, and specify the length | Inferred | ✗
| `@ElementCollection` | Declare that a collection is mapped to a dedicated table | | ✓
| `@Id` | Declare a basic-typed identifier attribute | | ✔
| `@Version` | Declare a version attribute | | ✔
| `@Basic` | Declare a basic attribute | Default | ✔
| `@EmbeddedId` | Declare an embeddable-typed identifier attribute | | ✔
| `@Embedded` | Declare an embeddable-typed attribute | Inferred | ✔
| `@Enumerated` | Declare an `enum`-typed attribute and specify how it is encoded | Inferred | ✔
| `@Array` | Declare that an attribute maps to a SQL `ARRAY`, and specify the length | Inferred | ✖
| `@ElementCollection` | Declare that a collection is mapped to a dedicated table | | ✔
|===

.Converters and compositional basic types
[%breakable,cols="22,~,^13"]
|===
| Annotation | Purpose | JPA-standard

| `@Converter` | Register an `AttributeConverter` | ✓
| `@Convert` | Apply a converter to an attribute | ✓
| `@JavaType` | Explicitly specify an implementation of `JavaType` for a basic attribute | ✗
| `@JdbcType` | Explicitly specify an implementation of `JdbcType` for a basic attribute | ✗
| `@JdbcTypeCode` | Explicitly specify a JDBC type code used to determine the `JdbcType` for a basic attribute | ✗
| `@JavaTypeRegistration` | Register a `JavaType` for a given Java type | ✗
| `@JdbcTypeRegistration` | Register a `JdbcType` for a given JDBC type code | ✗
| `@Converter` | Register an `AttributeConverter` | ✔
| `@Convert` | Apply a converter to an attribute | ✔
| `@JavaType` | Explicitly specify an implementation of `JavaType` for a basic attribute | ✖
| `@JdbcType` | Explicitly specify an implementation of `JdbcType` for a basic attribute | ✖
| `@JdbcTypeCode` | Explicitly specify a JDBC type code used to determine the `JdbcType` for a basic attribute | ✖
| `@JavaTypeRegistration` | Register a `JavaType` for a given Java type | ✖
| `@JdbcTypeRegistration` | Register a `JdbcType` for a given JDBC type code | ✖
|===

.System-generated identifiers
[%breakable,cols="22,~,^13"]
|===
| Annotation | Purpose | JPA-standard

| `@GeneratedValue` | Specify that an identifier is system-generated | ✓
| `@SequenceGenerator` | Define an id generated backed by on a database sequence | ✓
| `@TableGenerator` | Define an id generated backed by a database table | ✓
| `@IdGeneratorType` | Declare an annotation that associates a custom `Generator` with each `@Id` attribute it annotates | ✗
| `@ValueGenerationType` | Declare an annotation that associates a custom `Generator` with each `@Basic` attribute it annotates | ✗
| `@GeneratedValue` | Specify that an identifier is system-generated | ✔
| `@SequenceGenerator` | Define an id generated backed by on a database sequence | ✔
| `@TableGenerator` | Define an id generated backed by a database table | ✔
| `@IdGeneratorType` | Declare an annotation that associates a custom `Generator` with each `@Id` attribute it annotates | ✖
| `@ValueGenerationType` | Declare an annotation that associates a custom `Generator` with each `@Basic` attribute it annotates | ✖
|===

.Declaring entity associations
[%breakable,cols="22,~,^13"]
|===
| Annotation | Purpose | JPA-standard

| `@ManyToOne` | Declare the single-valued side of a many-to-one association (the owning side) | ✓
| `@OneToMany` | Declare the many-valued side of a many-to-one association (the unowned side) | ✓
| `@ManyToMany` | Declare either side of a one-to-one association | ✓
| `@OneToOne` | Declare either side of a one-to-one association | ✓
| `@MapsId` | Declare that the owning side of a `@OneToOne` association maps the primary key column | ✓
| `@ManyToOne` | Declare the single-valued side of a many-to-one association (the owning side) | ✔
| `@OneToMany` | Declare the many-valued side of a many-to-one association (the unowned side) | ✔
| `@ManyToMany` | Declare either side of a one-to-one association | ✔
| `@OneToOne` | Declare either side of a one-to-one association | ✔
| `@MapsId` | Declare that the owning side of a `@OneToOne` association maps the primary key column | ✔
|===

Phew!
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
:pdf-theme: theme.yml
:pdf-theme: ../pdf/theme.yml
:source-highlighter: rouge
:icons: font
:doctype: book
:pdf-fontsdir: fonts
:pdf-fontsdir: ../pdf/fonts
:docsBase: https://docs.jboss.org/hibernate/orm
:versionDocBase: {docsBase}/6.3
:userGuideBase: {versionDocBase}/userguide/html_single/Hibernate_User_Guide.html
Expand Down Expand Up @@ -39,7 +39,7 @@ include::Mapping.adoc[]

include::Interacting.adoc[]

// include::../userguide/chapters/query/hql/QueryLanguage.adoc[]
// include::../userguide/chapters/query/hql/Hibernate_Query_Language.adoc[]

<<<

Expand Down

0 comments on commit 4c8ed70

Please sign in to comment.