Skip to content

Commit e9dce35

Browse files
committed
misc updates to Short Guide before release
1 parent e203f47 commit e9dce35

File tree

4 files changed

+27
-15
lines changed

4 files changed

+27
-15
lines changed

documentation/src/main/asciidoc/introduction/Configuration.adoc

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -397,13 +397,14 @@ properties:
397397
| Configuration property name | Purpose
398398

399399
| `jakarta.persistence.schema-generation.database.action`
400-
a| * If `drop-and-create`, first drop the schema and then export tables, sequences, and constraints
401-
* If `create`, export tables, sequences, and constraints, without attempting to drop them first
402-
* If `create-drop`, drop the schema and recreate it on `SessionFactory` startup
403-
Additionally, drop the schema on `SessionFactory` shutdown
400+
a| * If `drop-and-create`, first drop the schema, then export tables, sequences, and constraints, and then populate initial data
401+
* If `create`, export tables, sequences, and constraints, without attempting to drop them first, and then populate initial data
402+
* If `create-drop`, drop the schema and recreate it on `SessionFactory` startup;
403+
additionally, drop the schema on `SessionFactory` shutdown
404404
* If `drop`, drop the schema on `SessionFactory` shutdown
405405
* If `validate`, validate the database schema without changing it
406-
* If `update`, only export what's missing in the schema
406+
* If `update`, only export what's missing in the schema, and alter incorrect column types
407+
* If `populate`, only populate initial data
407408

408409
| `jakarta.persistence.create-database-schemas`
409410
| (Optional) If `true`, automatically create schemas and catalogs
@@ -478,7 +479,7 @@ logger.jdbc-extract.level=trace
478479
479480
----
480481

481-
But with this approach we miss out on the pretty highlighting.
482+
SQL logging respects the settings `hibernate.format_sql` and `hibernate.highlight_sql`, so we don't miss out on the pretty formatting and highlighting.
482483

483484
[[minimizing]]
484485
=== Minimizing repetitive mapping information

documentation/src/main/asciidoc/introduction/Entities.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ When XML-based mappings are used, the `<entity>` element is used to declare an e
7171
Since the `orm.xml` mapping file format defined by the JPA specification was modelled closely on the annotation-based mappings, it's usually easy to go back and forth between the two options.
7272
****
7373

74-
We won't have much more to say about XML-based mappings in this Introduction, since it's not our preferred way to do things.
74+
We won't have much more to say about XML-based mappings in this Short Guide, since it's not our preferred way to do things.
7575

7676
."Dynamic" models
7777
****
@@ -1189,7 +1189,7 @@ bit more type safe:
11891189
@OneToMany(mappedBy=Book_.PUBLISHER) // get used to doing it this way!
11901190
Set<Book> books;
11911191
----
1192-
We're going to use this approach for the rest of the Introduction.
1192+
We're going to use this approach for the rest of the Short Guide.
11931193

11941194
To modify a bidirectional association, we must change the _owning side_.
11951195

documentation/src/main/asciidoc/introduction/Interacting.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ Hibernate features three complementary ways to write queries:
695695

696696
:hql: {doc-user-guide-url}#query-language
697697

698-
A full discussion of the query language would require almost as much text as the rest of this Introduction.
698+
A full discussion of the query language would require almost as much text as the rest of this Short Guide.
699699
Fortunately, HQL is already described in exhaustive (and exhausting) detail in {doc-query-language-url}[_A Guide to Hibernate Query Language_].
700700
It doesn't make sense to repeat that information here.
701701
// The query language is discussed in great detail below in <<query-language>>.

documentation/src/main/asciidoc/introduction/Introduction.adoc

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ We're going to <<organizing-persistence,come back soon>> to the thorny question
161161

162162
Before we get deeper into the weeds, we'll quickly present a basic example program that will help you get started if you don't already have Hibernate integrated into your project.
163163

164-
We begin with a simple gradle build file:
164+
We begin with a simple https://gradle.org[Gradle] build file:
165165

166166
[[build-gradle]]
167167
[source,groovy,subs="attributes+"]
@@ -203,7 +203,7 @@ dependencies {
203203

204204
Only the first of these dependencies is absolutely _required_ to run Hibernate.
205205

206-
Next, we'll add a logging configuration file for log4j:
206+
Next, we'll add a logging configuration file for https://logging.apache.org/log4j/[log4j]:
207207

208208
[source,properties]
209209
.`log4j2.properties`
@@ -212,17 +212,28 @@ rootLogger.level = info
212212
rootLogger.appenderRefs = console
213213
rootLogger.appenderRef.console.ref = console
214214
215+
# SQL statements (set level=debug to enable)
215216
logger.hibernate.name = org.hibernate.SQL
216217
logger.hibernate.level = info
217-
218+
# JDBC parameter binding (set level=trace to enable)
219+
logger.jdbc-bind.name=org.hibernate.orm.jdbc.bind
220+
logger.jdbc-bind.level=info
221+
# JDBC result set extraction (set level=trace to enable)
222+
logger.jdbc-extract.name=org.hibernate.orm.jdbc.extract
223+
logger.jdbc-extract.level=info
224+
# JDBC batching (set level=trace to enable)
225+
logger.batch.name=org.hibernate.orm.jdbc.batch
226+
logger.batch.level=info
227+
228+
# direct log output to the console
218229
appender.console.name = console
219230
appender.console.type = Console
220231
appender.console.layout.type = PatternLayout
221232
appender.console.layout.pattern = %highlight{[%p]} %m%n
222233
----
223234

224235
Now we need some Java code.
225-
We begin with our _entity class_:
236+
We begin with our <<domain-model,_entity class_>>:
226237

227238
[[book]]
228239
[source,java]
@@ -251,9 +262,9 @@ class Book {
251262
}
252263
----
253264

254-
Finally, let's see code which configures and instantiates Hibernate and asks it to persist and query the entity.
265+
Finally, let's see code which <<configuration,configures>> and instantiates Hibernate and asks it to <<interacting,persist and query>> the entity.
255266
Don't worry if this makes no sense at all right now.
256-
It's the job of this Introduction to make all this crystal clear.
267+
It's the job of the rest of this Short Guide to make all this crystal clear.
257268

258269
[[main-hibernate]]
259270
[source,java]

0 commit comments

Comments
 (0)