Skip to content

Commit 0ba1d69

Browse files
committed
HHH-5152 - Update Configuration chapter (chapter 3) to reflect Hibernate Annotations
1 parent 66f5fd3 commit 0ba1d69

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

documentation/src/main/asciidoc/userguide/appendices/Configurations.adoc

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ Accepts either:
209209

210210
See information on `org.hibernate.boot.archive.scan.spi.Scanner` about expected constructor forms.
211211

212-
|`hibernate.archive.autodetection` | `true` or `false` (default value) a|
212+
|`hibernate.archive.autodetection` | `hbm,class` (default value) a|
213213

214214
Identifies a comma-separate list of values indicating the mapping types we should auto-detect during scanning.
215215

@@ -218,12 +218,18 @@ Allowable values include:
218218
`class`:: scan classes (e.g. `.class`) to extract entity mapping metadata
219219
`hbm`:: scan `hbm` mapping files (e.g. `hbm.xml`) to extract entity mapping metadata
220220

221-
|`hibernate.mapping.precedence` | `true` or `false` (default value) |
221+
Bu default both HBM, annotations, and JPA XML mappings are scanned.
222+
223+
When using JPA, to disable the automatic scanning of all entity classes, the `exclude-unlisted-classes` `persistence.xml` element must be set to false.
224+
225+
|`hibernate.mapping.precedence` | `hbm,class` (default value) |
222226

223227
Used to specify the order in which metadata sources should be processed.
224228
Value is a delimited-list whose elements are defined by `org.hibernate.cfg.MetadataSourceType`.
225229

226-
Default is `hbm,class"` which indicates to process `hbm.xml` files followed by annotations (combined with `orm.xml` mappings).
230+
Default is `hbm,class"`, therefore `hbm.xml` files are processed first, followed by annotations (combined with `orm.xml` mappings).
231+
232+
When using JPA, the XML mapping overrides a conflicting annotation mapping that targets the same entity attribute.
227233

228234
3+|JDBC-related options
229235
|`hibernate.use_nationalized_character_data` |`true` or `false` (default value) |Enable nationalized character support on all string / clob based attribute ( string, char, clob, text etc ).

0 commit comments

Comments
 (0)