diff --git a/build.gradle b/build.gradle index 9b8f4c7a84..76cafeecca 100644 --- a/build.gradle +++ b/build.gradle @@ -5,8 +5,8 @@ allprojects { repositories { mavenCentral() mavenLocal() - mavenRepo name: 'jboss-nexus', urls: "https://repository.jboss.org/nexus/content/groups/public/" - mavenRepo name: "jboss-snapshots", urls: "http://snapshots.jboss.org/maven2/" + mavenRepo name: 'jboss-nexus', url: "https://repository.jboss.org/nexus/content/groups/public/" + mavenRepo name: "jboss-snapshots", url: "http://snapshots.jboss.org/maven2/" } } @@ -14,34 +14,55 @@ buildscript { repositories { mavenCentral() mavenLocal() - mavenRepo name: 'jboss-nexus', urls: "https://repository.jboss.org/nexus/content/groups/public/" - mavenRepo name: "jboss-snapshots", urls: "http://snapshots.jboss.org/maven2/" + mavenRepo name: 'jboss-nexus', url: "https://repository.jboss.org/nexus/content/groups/public/" + mavenRepo name: "jboss-snapshots", url: "http://snapshots.jboss.org/maven2/" } dependencies { - classpath 'org.hibernate.build.gradle:gradle-upload-auth-plugin:1.0.2' + classpath 'org.hibernate.build.gradle:gradle-upload-auth-plugin:1.1.0' } } -ideaProject { - javaVersion = "1.6" - withXml { provider -> - def node = provider.asNode() - def vcsConfig = node.component.find { it.'@name' == 'VcsDirectoryMappings' } - vcsConfig.mapping[0].'@vcs' = 'Git' - def maxHeapSizeConfig = node.component.find { it.'@name' == 'JavacSettings' } - if( maxHeapSizeConfig == null ){ - def javacSettingsNode = node.appendNode('component',[name: 'JavacSettings']) - javacSettingsNode.appendNode('option', [name:"MAXIMUM_HEAP_SIZE", value:"512"]) - } - } - beforeConfigured { module -> - module.modulePaths.removeAll { it.filePath.endsWith('hibernate-core.iml') } - } -} - -ideaModule { - moduleName = 'hibernate-core-root' +idea { + project { + jdkName = "1.6" + ipr { + withXml { provider -> + provider.node.component.find { it.@name == 'VcsDirectoryMappings' }.mapping.@vcs = 'Git' + def maxHeapSizeConfig = provider.node.component.find { it.@name == 'JavacSettings' } + if( maxHeapSizeConfig == null ){ + def javacSettingsNode = provider.node.appendNode('component',[name: 'JavacSettings']) + javacSettingsNode.appendNode('option', [name:"MAXIMUM_HEAP_SIZE", value:"512"]) + } + } + beforeMerged { project -> + project.modulePaths.clear() + } + } + } + module { + name = "hibernate-orm" + } } +//ideaProject { +// javaVersion = "1.6" +// withXml { provider -> +// def node = provider.asNode() +// def vcsConfig = node.component.find { it.'@name' == 'VcsDirectoryMappings' } +// vcsConfig.mapping[0].'@vcs' = 'Git' +// def maxHeapSizeConfig = node.component.find { it.'@name' == 'JavacSettings' } +// if( maxHeapSizeConfig == null ){ +// def javacSettingsNode = node.appendNode('component',[name: 'JavacSettings']) +// javacSettingsNode.appendNode('option', [name:"MAXIMUM_HEAP_SIZE", value:"512"]) +// } +// } +// beforeConfigured { module -> +// module.modulePaths.removeAll { it.filePath.endsWith('hibernate-core.iml') } +// } +//} +// +//ideaModule { +// moduleName = 'hibernate-core-root' +//} // build a map of the dependency artifacts to use. Allows centralized definition of the version of artifacts to // use. In that respect it serves a role similar to in Maven @@ -227,30 +248,62 @@ subprojects { subProject -> targetCompatibility = "1.6" sourceCompatibility = "1.6" - ideaModule { - beforeConfigured { module -> - module.excludeFolders.clear() - } - scopes.COMPILE.plus.add( configurations.provided ) - whenConfigured { module -> - module.dependencies*.exported = true - } - excludeDirs = [ - file(".gradle"), - file("$buildDir/classes"), - file("$buildDir/dependency-cache"), - file("$buildDir/libs"), - file("$buildDir/reports"), - file("$buildDir/test-results"), - file("$buildDir/tmp"), - file("$buildDir/matrix") - ] as Set - } - - eclipseClasspath { - plusConfigurations.add( configurations.provided ) + idea { + module { + iml { + beforeMerged { module -> + module.dependencies.clear() + module.excludeFolders.clear() + } + whenMerged { module -> + module.dependencies*.exported = true + module.excludeFolders = [ + file(".gradle"), + file("$buildDir/bundles"), + file("$buildDir/classes"), + file("$buildDir/dependency-cache"), + file("$buildDir/libs"), + file("$buildDir/reports"), + file("$buildDir/test-results"), + file("$buildDir/tmp"), + file("$buildDir/matrix") + ] as Set + } + } + downloadSources = true + scopes.COMPILE.plus += configurations.provided + } } +// ideaModule { +// beforeConfigured { module -> +// module.excludeFolders.clear() +// } +// scopes.COMPILE.plus.add( configurations.provided ) +// whenConfigured { module -> +// module.dependencies*.exported = true +// } +// excludeDirs = [ +// file(".gradle"), +// file("$buildDir/classes"), +// file("$buildDir/dependency-cache"), +// file("$buildDir/libs"), +// file("$buildDir/reports"), +// file("$buildDir/test-results"), +// file("$buildDir/tmp"), +// file("$buildDir/matrix") +// ] as Set +// } + + eclipse { + classpath { + plusConfigurations.add( configurations.provided ) + } + } +// eclipseClasspath { +// plusConfigurations.add( configurations.provided ) +// } + // elements used to customize the generated POM used during upload def pomConfig = { name 'A Hibernate Core Module' @@ -326,6 +379,5 @@ dependsOnChildren() // 2) /gradlew.bat which is the windows bat script for for executing builds // 3) /wrapper which is a directory named by the "jarPath" config which contains other needed files. task wrapper(type: Wrapper) { - // HHH-6106 - this is needed for IntellJ generation until 1.0-milestone-3 is released. - gradleVersion = '1.0-milestone-3' + gradleVersion = '1.0-milestone-8' } diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index b8085afa8d..fb27c20b66 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -30,7 +30,7 @@ buildDir = "target" repositories { mavenCentral() mavenLocal() - mavenRepo name: "jboss", urls: "http://repository.jboss.org/nexus/content/groups/public/" + mavenRepo name: "jboss", url: "http://repository.jboss.org/nexus/content/groups/public/" } targetCompatibility = "1.6" sourceCompatibility = "1.6" @@ -51,8 +51,10 @@ dependencies { groovy localGroovy() } -ideaModule { - downloadSources =true - downloadJavadoc= true - javaVersion = '1.6' +idea { + module { + downloadSources = true + downloadJavadoc = true + javaVersion = '1.6' + } } diff --git a/documentation/documentation.gradle b/documentation/documentation.gradle index 74bde4aaa8..92b91d72d5 100644 --- a/documentation/documentation.gradle +++ b/documentation/documentation.gradle @@ -2,10 +2,12 @@ buildscript { repositories { mavenCentral() mavenLocal() - mavenRepo name: "jboss", urls: "http://repository.jboss.org/nexus/content/groups/public/" + mavenRepo name: 'jboss-nexus', url: "https://repository.jboss.org/nexus/content/groups/public/" } dependencies { - classpath 'org.jboss.jdocbook:gradle-jdocbook:1.1.0' + classpath 'org.jboss.jdocbook:gradle-jdocbook:1.1.3' + classpath "org.jboss.pressgang:pressgang-xslt:2.0.1" + classpath "org.jboss.pressgang:pressgang-fonts:2.0.1" } } @@ -13,7 +15,10 @@ apply plugin: "java" apply plugin: "jdocbook" dependencies { - jdocbookStyles "org.hibernate:hibernate-jdocbook-style:2.0.1" + jdocbookStyles( "org.jboss.pressgang:pressgang-jdocbook-style:2.0.1" ) { + exclude group: 'org.eclipse.wst.css' + exclude group: 'org.eclipse.wst.sse' + } } defaultTasks 'buildDocs' @@ -49,6 +54,7 @@ jdocbook { // todo : make this part of gradle-jdocbook. // specifically the ability to supply ant-style resource for images (dir + include/exclude patterns) stageStyles_devguide.doLast { + logger.lifecycle( "Staging devguide-specific style resources") copy { into project.file( 'target/docbook/stage/devguide/images' ) from project.file( 'src/main/docbook/devguide/en-US' ) @@ -58,6 +64,17 @@ stageStyles_devguide.doLast { } } +[ 'devguide', 'manual', 'quickstart' ].each { bookName -> + tasks[ "stageStyles_$bookName" ].doLast { + logger.lifecycle( "Staging local style resources") + copy { + into project.file( "target/docbook/stage/$bookName" ) + from project.file( 'src/main/style' ) + includeEmptyDirs = false + } + } +} + task buildTutorialZip(type: Zip) { destinationDir = file( "target/work/tutorials" ) archiveName = 'hibernate-tutorials.zip' diff --git a/documentation/src/main/docbook/devguide/en-US/Author_Group.xml b/documentation/src/main/docbook/devguide/en-US/Author_Group.xml index a6f9c2f8a6..802ab8ce43 100644 --- a/documentation/src/main/docbook/devguide/en-US/Author_Group.xml +++ b/documentation/src/main/docbook/devguide/en-US/Author_Group.xml @@ -1,81 +1,80 @@ - - - - - Gavin - King - - - Christian - Bauer - + + - Steve - Ebersole + + Gavin + King + - Max - Rydahl - Andersen - + + Christian + Bauer + + - Emmanuel - Bernard - - - Hardy - Ferentschik - - - Adam - Warski - - - Gail - Badner - + + Steve + Ebersole + + + + + Max + Rydahl + Andersen + + + + + Emmanuel + Bernard + + + + + Hardy + Ferentschik + + + + + Adam + Warski + + + + + Gail + Badner + + - - James - Cobb - - Graphic Design - - - - Cheyenne - Weaver - - Graphic Design - - + + + James + Cobb + + + Graphic Design + + + + + Cheyenne + Weaver + + + Graphic Design + + - Misty - Stanley-Jones + + Misty + Stanley-Jones + diff --git a/documentation/src/main/docbook/devguide/en-US/Batch_Processing.xml b/documentation/src/main/docbook/devguide/en-US/Batch_Processing.xml index 17403e9d09..76cc3a0ff2 100644 --- a/documentation/src/main/docbook/devguide/en-US/Batch_Processing.xml +++ b/documentation/src/main/docbook/devguide/en-US/Batch_Processing.xml @@ -1,17 +1,15 @@ - -%BOOK_ENTITIES; -]> - + + + Batch Processing The following example shows an antipattern for batch inserts. Naive way to insert 100000 lines with Hibernate - + This fails with exception OutOfMemoryException after around 50000 rows on most systems. The reason is that Hibernate caches all the newly inserted Customer instances in the session-level @@ -40,7 +38,7 @@ Flushing and clearing the <classname>Session</classname> - + @@ -53,7 +51,7 @@ Using <methodname>scroll()</methodname> - + @@ -113,7 +111,7 @@ Using a <interfacename>StatelessSession</interfacename> - + The Customer instances returned by the query are immediately detached. They are never associated with any persistence context. @@ -158,7 +156,7 @@ Executing an HQL UPDATE, using the <methodname>Query.executeUpdate()</methodname> method - + In keeping with the EJB3 specification, HQL UPDATE statements, by default, do not effect the version or the @@ -168,7 +166,7 @@ Updating the version of timestamp - + @@ -178,7 +176,7 @@ A HQL <literal>DELETE</literal> statement - + Method Query.executeUpdate() returns an int value, which indicates the @@ -233,7 +231,7 @@ HQL INSERT statement - +
diff --git a/documentation/src/main/docbook/devguide/en-US/Book_Info.xml b/documentation/src/main/docbook/devguide/en-US/Book_Info.xml deleted file mode 100644 index a58cc4c983..0000000000 --- a/documentation/src/main/docbook/devguide/en-US/Book_Info.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - -%BOOK_ENTITIES; -]> - - - Hibernate Developer Guide - &version; - 1.0 - 1 - JBoss Hibernate Core - &version; - &today; - 1 - - - - - - - - - - ©rightYear; - ©rightHolder; - - - - - diff --git a/documentation/src/main/docbook/devguide/en-US/Caching.xml b/documentation/src/main/docbook/devguide/en-US/Caching.xml index 9a1a773ba4..213b39cecf 100644 --- a/documentation/src/main/docbook/devguide/en-US/Caching.xml +++ b/documentation/src/main/docbook/devguide/en-US/Caching.xml @@ -1,11 +1,11 @@ - -%BOOK_ENTITIES; -]> - - Caching + + + + Caching +
The query cache @@ -74,7 +74,7 @@ Method <methodname>setCacheRegion</methodname> - + @@ -171,7 +171,7 @@ Configuring cache providers using annotations - + You can cache the content of a collection or the identifiers, if the collection contains other entities. Use the @Cache annotation on the Collection property. @@ -250,8 +250,7 @@ Configuring cache providers using mapping files - + Just as in the , you can provide attributes in the mapping file. There are some specific differences in the syntax for the attributes in a mapping file. @@ -507,7 +506,7 @@ Evicting an item from the first-level cache - + Determining whether an item belongs to the Session cache @@ -523,7 +522,7 @@ You can evict the cached state of an instance, entire class, collection instance or entire collection role, using methods of SessionFactory. - +
Interactions between a Session and the second-level cache @@ -573,9 +572,8 @@ - Browsing the second-level cache entries via the Statistics API + Browsing the second-level cache entries via the Statistics API +
diff --git a/documentation/src/main/docbook/devguide/en-US/Data_Categorizations.xml b/documentation/src/main/docbook/devguide/en-US/Data_Categorizations.xml index c14ee41415..472e4aeb7d 100644 --- a/documentation/src/main/docbook/devguide/en-US/Data_Categorizations.xml +++ b/documentation/src/main/docbook/devguide/en-US/Data_Categorizations.xml @@ -1,9 +1,7 @@ - -%BOOK_ENTITIES; -]> - + + + Data categorizations Hibernate understands both the Java and JDBC representations of application data. The ability to read and write @@ -24,11 +22,11 @@ - Hibernate categorizes types into two high-level groups: and . + Hibernate categorizes types into two high-level groups: + and . -
+
Value types A value type does not define its own lifecycle. It is, in effect, owned by an -
+
Basic types Basic value types usually map a single database value, or column, to a single, non-aggregated Java @@ -297,7 +295,7 @@
-
+
Composite types Composite types, or embedded types, as they are called by the Java @@ -315,7 +313,7 @@
-
+
Collection types A collection type refers to the data type itself, not its contents. @@ -328,7 +326,7 @@
-
+
Entity Types Entities are application-specific classes which correlate to rows in a table, using a unique identifier. Because diff --git a/documentation/src/main/docbook/devguide/en-US/Database_Access.xml b/documentation/src/main/docbook/devguide/en-US/Database_Access.xml index a261353f9e..a7b75cdea0 100644 --- a/documentation/src/main/docbook/devguide/en-US/Database_Access.xml +++ b/documentation/src/main/docbook/devguide/en-US/Database_Access.xml @@ -1,9 +1,9 @@ - -%BOOK_ENTITIES; -]> - + + + Database access
@@ -49,15 +49,11 @@ <filename>hibernate.properties</filename> for a c3p0 connection pool - - - + <filename>hibernate.cfg.xml</filename> for a connection to the bundled HSQL database - - - +
@@ -76,8 +72,7 @@ directly and specifying XML mapping documents. If the mapping files are in the classpath, use method addResource(). - + Letting Hibernate find the mapping files for you @@ -87,11 +82,11 @@ org/hibernate/auction/Item.hbm.xml and org/hibernate/auction/Bid.hbm.xml. - + Specifying configuration properties - + Other ways to configure Hibernate programmatically @@ -120,9 +115,7 @@ Specifying configuration properties - - - + Most important Hibernate JDBC properties @@ -172,8 +165,7 @@ lib/ directory. Hibernate uses its org.hibernate.service.jdbc.connections.internal.ProxoolConnectionProvider for connection pooling if you set the hibernate.proxool.* properties. Unlike c3p0, proxool requires some additional configuration - parameters, as described by the Proxool documentation available at . + parameters, as described by the Proxool documentation available at . Important configuration properties for the Proxool connection pool diff --git a/documentation/src/main/docbook/devguide/en-US/Envers.xml b/documentation/src/main/docbook/devguide/en-US/Envers.xml index 2147263057..05e3fb2e81 100644 --- a/documentation/src/main/docbook/devguide/en-US/Envers.xml +++ b/documentation/src/main/docbook/devguide/en-US/Envers.xml @@ -1,24 +1,20 @@ - -%BOOK_ENTITIES; -]> - - Envers - - - Preface - - The aim of Hibernate Envers is to provide historical versioning of your application's entity data. Much - like source control management tools such as Subversion or Git, Hibernate Envers manages a notion of revisions - if your application data through the use of audit tables. Each transaction relates to one global revision number - which can be used to identify groups of changes (much like a change set in source control). As the revisions - are global, having a revision number, you can query for various entities at that revision, retrieving a - (partial) view of the database at that revision. You can find a revision number having a date, and the other - way round, you can get the date at which a revision was committed. - - + + + Envers + + + The aim of Hibernate Envers is to provide historical versioning of your application's entity data. Much + like source control management tools such as Subversion or Git, Hibernate Envers manages a notion of revisions + if your application data through the use of audit tables. Each transaction relates to one global revision number + which can be used to identify groups of changes (much like a change set in source control). As the revisions + are global, having a revision number, you can query for various entities at that revision, retrieving a + (partial) view of the database at that revision. You can find a revision number having a date, and the other + way round, you can get the date at which a revision was committed. + + +
Basics @@ -52,7 +48,7 @@ The audit (history) of an entity can be accessed using the AuditReader interface, which - can be obtained having an open EntityManager or Session via + can be obtained having an open EntityManager or Session via the AuditReaderFactory. See the javadocs for these classes for details on the functionality offered. @@ -398,7 +394,7 @@
-
+
Revision Log Logging data for revisions @@ -408,14 +404,18 @@ - revision number - An integral value (int/Integer or - long/Long). Essentially the primary key of the revision + + revision number - An integral value (int/Integer or + long/Long). Essentially the primary key of the revision + - revision timestamp - either a long/Long or - java.util.Date value representing the instant at which the revision was made. - When using a java.util.Date, instead of a long/Long for - the revision timestamp, take care not to store it to a column data type which will loose precision. + + revision timestamp - either a long/Long or + java.util.Date value representing the instant at which the revision was made. + When using a java.util.Date, instead of a long/Long for + the revision timestamp, take care not to store it to a column data type which will loose precision. + @@ -530,7 +530,7 @@ public class ExampleListener implements RevisionListener { -
+
Tracking entity names modified during revisions By default entity types that have been changed in each revision are not being tracked. This implies the @@ -544,14 +544,18 @@ public class ExampleListener implements RevisionListener { - Set org.hibernate.envers.track_entities_changed_in_revision parameter to - true. In this case - org.hibernate.envers.DefaultTrackingModifiedEntitiesRevisionEntity will - be implicitly used as the revision log entity. + + Set org.hibernate.envers.track_entities_changed_in_revision parameter to + true. In this case + org.hibernate.envers.DefaultTrackingModifiedEntitiesRevisionEntity will + be implicitly used as the revision log entity. + - Create a custom revision entity that extends - org.hibernate.envers.DefaultTrackingModifiedEntitiesRevisionEntity class. + + Create a custom revision entity that extends + org.hibernate.envers.DefaultTrackingModifiedEntitiesRevisionEntity class. + - Mark an appropriate field of a custom revision entity with - @org.hibernate.envers.ModifiedEntityNames annotation. The property is - required to be of ]]> type. + + Mark an appropriate field of a custom revision entity with + @org.hibernate.envers.ModifiedEntityNames annotation. The property is + required to be of ]]> type. + modifiedEntityTypes = revEntity.getModifiedEntityT
-
+
Tracking entity changes at property level By default the only information stored by Envers are revisions of modified entities. @@ -681,16 +687,16 @@ Set modifiedEntityTypes = revEntity.getModifiedEntityT - setting - org.hibernate.envers.global_with_modified_flag - configuration property to - true. - This global switch will cause adding modification flags for all audited - properties in all audited entities. + + setting org.hibernate.envers.global_with_modified_flag configuration + property to true. This global switch will cause adding modification flags + for all audited properties in all audited entities. + - using @Audited(withModifiedFlag=true) - on a property or on an entity. + + using @Audited(withModifiedFlag=true) on a property or on an entity. + @@ -710,7 +716,7 @@ Set modifiedEntityTypes = revEntity.getModifiedEntityT
-
+
Queries @@ -723,9 +729,8 @@ Set modifiedEntityTypes = revEntity.getModifiedEntityT - The queries in Envers are similar to - Hibernate Criteria, - so if you are common with them, using Envers queries will be much easier. + The queries in Envers are similar to Hibernate Criteria queries, so if you are common with them, + using Envers queries will be much easier. @@ -746,7 +751,7 @@ Set modifiedEntityTypes = revEntity.getModifiedEntityT . -
+
Querying for entities of a class at a given revision @@ -796,7 +801,7 @@ query.add(AuditEntity.relatedId("address").eq(relatedEntityId));]]> -
+
Querying for revisions, at which entities of a given class changed @@ -899,7 +904,7 @@ query.add(AuditEntity.relatedId("address").eq(relatedEntityId));]]> -
+
Querying for revisions of entity that modified given property @@ -971,7 +976,7 @@ query.add(AuditEntity.relatedId("address").eq(relatedEntityId));]]> -
+
Querying for entities modified in a given revision The basic query allows retrieving entity names and corresponding Java classes changed in a specified revision: @@ -983,22 +988,28 @@ query.add(AuditEntity.relatedId("address").eq(relatedEntityId));]]> - List]]> findEntities(Number) - - Returns snapshots of all audited entities changed (added, updated and removed) in a given revision. - Executes n+1 SQL queries, where n is a number of different entity - classes modified within specified revision. + + List]]> findEntities(Number) + - Returns snapshots of all audited entities changed (added, updated and removed) in a given revision. + Executes n+1 SQL queries, where n is a number of different entity + classes modified within specified revision. + - List]]> findEntities(Number, RevisionType) - - Returns snapshots of all audited entities changed (added, updated or removed) in a given revision - filtered by modification type. Executes n+1 SQL queries, where n - is a number of different entity classes modified within specified revision. + + List]]> findEntities(Number, RevisionType) + - Returns snapshots of all audited entities changed (added, updated or removed) in a given revision + filtered by modification type. Executes n+1 SQL queries, where n + is a number of different entity classes modified within specified revision. + - >]]> findEntitiesGroupByRevisionType(Number) - - Returns a map containing lists of entity snapshots grouped by modification operation (e.g. - addition, update and removal). Executes 3n+1 SQL queries, where n - is a number of different entity classes modified within specified revision. + + >]]> findEntitiesGroupByRevisionType(Number) + - Returns a map containing lists of entity snapshots grouped by modification operation (e.g. + addition, update and removal). Executes 3n+1 SQL queries, where n + is a number of different entity classes modified within specified revision. + @@ -1021,28 +1032,36 @@ query.add(AuditEntity.relatedId("address").eq(relatedEntityId));]]> - - Turn off automatic Envers event listeners registration by setting the - hibernate.listeners.envers.autoRegister - Hibernate property to false. - - - Create subclasses for appropriate event listeners. For example, if you want to conditionally audit - entity insertions, extend the - org.hibernate.envers.eventEnversPostInsertEventListenerImpl - class. Place the conditional-auditing logic in the subclasses, call the super method if auditing - should be performed. - - - Create your own implementation of org.hibernate.integrator.spi.Integrator, - similar to org.hibernate.envers.event.EnversIntegrator. Use your event listener - classes instead of the default ones. - - - For the integrator to be automatically used when Hibernate starts up, you will need to add a - META-INF/services/org.hibernate.integrator.spi.Integrator file to your jar. - The file should contain the fully qualified name of the class implementing the interface. - + + + Turn off automatic Envers event listeners registration by setting the + hibernate.listeners.envers.autoRegister Hibernate property to + false. + + + + + Create subclasses for appropriate event listeners. For example, if you want to + conditionally audit entity insertions, extend the + org.hibernate.envers.eventEnversPostInsertEventListenerImpl + class. Place the conditional-auditing logic in the subclasses, call the super method if + auditing should be performed. + + + + + Create your own implementation of org.hibernate.integrator.spi.Integrator, + similar to org.hibernate.envers.event.EnversIntegrator. Use your event + listener classes instead of the default ones. + + + + + For the integrator to be automatically used when Hibernate starts up, you will need to add a + META-INF/services/org.hibernate.integrator.spi.Integrator file to your jar. + The file should contain the fully qualified name of the class implementing the interface. + +
@@ -1103,7 +1122,7 @@ query.add(AuditEntity.relatedId("address").eq(relatedEntityId));]]> - Additionally, there is a revision entity table which contains the information about the + Additionally, there is a revision entity table which contains the information about the global revision. By default the generated table is named REVINFO and contains just 2 columns: ID and TIMESTAMP. A row is inserted into this table on each new revision, that is, on each commit of a transaction, which @@ -1124,7 +1143,7 @@ query.add(AuditEntity.relatedId("address").eq(relatedEntityId));]]> -
+
Generating schema with Ant @@ -1219,7 +1238,7 @@ query.add(AuditEntity.relatedId("address").eq(relatedEntityId));]]> -
+
Mapping exceptions
@@ -1287,9 +1306,7 @@ query.add(AuditEntity.relatedId("address").eq(relatedEntityId));]]> One special case are relations mapped with @OneToMany+@JoinColumn on the one side, and @ManyToOne+@JoinColumn(insertable=false, updatable=false) - on the many side. - Such relations are in fact bidirectional, but the owning side is the collection (see alse - here). + on the many side. Such relations are in fact bidirectional, but the owning side is the collection. To properly audit such relations with Envers, you can use the @AuditMappedBy annotation. @@ -1303,10 +1320,10 @@ query.add(AuditEntity.relatedId("address").eq(relatedEntityId));]]>
-
+
Advanced: Audit table partitioning -
+
Benefits of audit table partitioning @@ -1330,7 +1347,7 @@ query.add(AuditEntity.relatedId("address").eq(relatedEntityId));]]> -
+
Suitable columns for audit table partitioning @@ -1400,7 +1417,7 @@ query.add(AuditEntity.relatedId("address").eq(relatedEntityId));]]> -
+
Audit table partitioning example @@ -1526,7 +1543,7 @@ query.add(AuditEntity.relatedId("address").eq(relatedEntityId));]]> -
+
Determining a suitable partitioning column @@ -1563,7 +1580,7 @@ query.add(AuditEntity.relatedId("address").eq(relatedEntityId));]]> -
+
Determining a suitable partitioning scheme @@ -1631,39 +1648,39 @@ query.add(AuditEntity.relatedId("address").eq(relatedEntityId));]]>
-
- For information on specific configuration of Proxool, refer to the Proxool documentation available from . + For information on specific configuration of Proxool, refer to the Proxool documentation available from + .
diff --git a/documentation/src/main/docbook/devguide/en-US/appendix-Troubleshooting.xml b/documentation/src/main/docbook/devguide/en-US/appendix-Troubleshooting.xml index 1cda4f5891..a7d9c83a70 100644 --- a/documentation/src/main/docbook/devguide/en-US/appendix-Troubleshooting.xml +++ b/documentation/src/main/docbook/devguide/en-US/appendix-Troubleshooting.xml @@ -1,9 +1,7 @@ - -%BOOK_ENTITIES; -]> - + + + Troubleshooting
diff --git a/documentation/src/main/docbook/devguide/en-US/chapters/events/Events.xml b/documentation/src/main/docbook/devguide/en-US/chapters/events/Events.xml index fdcf3f0976..b1f0f607d8 100644 --- a/documentation/src/main/docbook/devguide/en-US/chapters/events/Events.xml +++ b/documentation/src/main/docbook/devguide/en-US/chapters/events/Events.xml @@ -1,11 +1,10 @@ - -%BOOK_ENTITIES; -]> + - Interceptors and events @@ -42,7 +41,7 @@ A Session-scoped interceptor is specified when a session is opened. - + A SessionFactory-scoped interceptor is registered with the Configuration object @@ -52,7 +51,7 @@ states, since multiple sessions will use this interceptor potentially concurrently. - +
@@ -96,10 +95,10 @@ - + Custom LoadListener example - - + +
@@ -118,9 +117,9 @@ - + JACC listener registration example - + @@ -233,10 +232,10 @@ - + Example of specifying JPA callbacks - - + + These approaches can be mixed, meaning you can use both together. diff --git a/documentation/src/main/docbook/devguide/en-US/chapters/multitenancy/Multi_Tenancy.xml b/documentation/src/main/docbook/devguide/en-US/chapters/multitenancy/Multi_Tenancy.xml index ecf192d3ec..11f9b1da1f 100644 --- a/documentation/src/main/docbook/devguide/en-US/chapters/multitenancy/Multi_Tenancy.xml +++ b/documentation/src/main/docbook/devguide/en-US/chapters/multitenancy/Multi_Tenancy.xml @@ -1,10 +1,9 @@ - -%BOOK_ENTITIES; -]> - + + Multi-tenancy
@@ -29,7 +28,7 @@ Each approach has pros and cons as well as specific techniques and considerations. Such topics are beyond the scope of this documentation. Many resources exist which delve into these - other topics. One example is + other topics. One example is which does a great job of covering these topics. @@ -126,7 +125,7 @@ Specifying tenant identifier from <interfacename>SessionFactory</interfacename> - + Additionally, when specifying configuration, a org.hibernate.MultiTenancyStrategy @@ -264,7 +263,7 @@ Strategies for <interfacename>MultiTenantConnectionProvider</interfacename> implementors Implementing MultiTenantConnectionProvider using different connection pools - + The approach above is valid for the DATABASE approach. It is also valid for the SCHEMA approach @@ -272,7 +271,7 @@ Implementing MultiTenantConnectionProvider using single connection pool - + This approach is only relevant to the SCHEMA approach. diff --git a/documentation/src/main/docbook/devguide/en-US/chapters/pc/Persistence_Context.xml b/documentation/src/main/docbook/devguide/en-US/chapters/pc/Persistence_Context.xml index 3277a71b10..c886d150d3 100644 --- a/documentation/src/main/docbook/devguide/en-US/chapters/pc/Persistence_Context.xml +++ b/documentation/src/main/docbook/devguide/en-US/chapters/pc/Persistence_Context.xml @@ -1,10 +1,11 @@ - -%BOOK_ENTITIES; -]> - - Persistence Contexts + + + + + Persistence Contexts + Both the org.hibernate.Session API and @@ -66,8 +67,8 @@ Example of making an entity persistent - - + + @@ -92,8 +93,8 @@ Example of deleting an entity - - + + It is important to note that Hibernate itself can handle deleting detached state. JPA, however, disallows @@ -179,8 +180,8 @@ Example of modifying managed state - - + +
@@ -214,8 +215,8 @@ Example of reattaching a detached entity - - + + The method name update is a bit misleading here. It does not mean that an @@ -239,15 +240,15 @@ Visualizing merge - + That is not exactly what happens, but its a good visualization. Example of merging a detached entity - - + +
@@ -262,13 +263,13 @@ Examples of verifying managed state - - + + Examples of verifying laziness - - + + In JPA there is an alternative means to check laziness using the following @@ -277,7 +278,7 @@ Alternative JPA means to verify laziness - +
@@ -289,7 +290,7 @@
Usage of EntityManager.unwrap - +
\ No newline at end of file diff --git a/documentation/src/main/docbook/devguide/en-US/chapters/query_criteria/Criteria.xml b/documentation/src/main/docbook/devguide/en-US/chapters/query_criteria/Criteria.xml index 9c7e5e42e7..ae8c10c677 100644 --- a/documentation/src/main/docbook/devguide/en-US/chapters/query_criteria/Criteria.xml +++ b/documentation/src/main/docbook/devguide/en-US/chapters/query_criteria/Criteria.xml @@ -1,9 +1,8 @@ - -%BOOK_ENTITIES; -]> - + + + Criteria @@ -12,11 +11,11 @@ - Hibernate offers an older, legacy org.hibernate.Criteria API which should be + Hibernate offers an older, legacy org.hibernate.Criteria API which should be considered deprecated. No feature development will target those APIs. Eventually, Hibernate-specific criteria features will be ported as extensions to the JPA - javax.persistence.criteria.CriteriaQuery. For details on the - org.hibernate.Criteria API, see . + javax.persistence.criteria.CriteriaQuery. For details on the + org.hibernate.Criteria API, see . This chapter will focus on the JPA APIs for declaring type-safe criteria queries. @@ -51,7 +50,7 @@ javax.persistence.criteria.CriteriaBuilder for this purpose: - + Each serves a different purpose depending on the expected type of the query results. @@ -83,7 +82,7 @@ Selecting the root entity - + @@ -116,7 +115,7 @@ Selecting an attribute - + @@ -141,7 +140,7 @@ Selecting an array - + @@ -158,7 +157,7 @@ Selecting an array (2) - + @@ -181,7 +180,7 @@ Selecting an wrapper - + @@ -213,7 +212,7 @@ Selecting a tuple - + @@ -311,11 +310,11 @@ javax.persistence.criteria.CriteriaQuery: - + Adding a root - + @@ -326,7 +325,7 @@ Adding multiple roots - +
@@ -342,12 +341,12 @@ Example with Embedded and ManyToOne - + Example with Collections - +
@@ -362,7 +361,7 @@ Example with Embedded and ManyToOne - + @@ -375,7 +374,7 @@ Example with Collections - +
@@ -394,7 +393,7 @@ Using parameters - + diff --git a/documentation/src/main/docbook/devguide/en-US/chapters/query_native/Native_SQL.xml b/documentation/src/main/docbook/devguide/en-US/chapters/query_native/Native_SQL.xml index 0fea23bb63..3b063670b2 100644 --- a/documentation/src/main/docbook/devguide/en-US/chapters/query_native/Native_SQL.xml +++ b/documentation/src/main/docbook/devguide/en-US/chapters/query_native/Native_SQL.xml @@ -1,10 +1,7 @@ - -%BOOK_ENTITIES; -]> - + + Native SQL Queries @@ -15,7 +12,7 @@ create, update, delete, and load operations. -
+
Using a <literal>SQLQuery</literal> Execution of native SQL queries is controlled via the @@ -226,7 +223,7 @@ List loggedCats = sess.createSQLQuery(sql) .addEntity("mother", Cat.class).list() -
+
Alias and property references In most cases the above alias injection is needed. For queries @@ -239,7 +236,7 @@ List loggedCats = sess.createSQLQuery(sql) simply examples; each alias will have a unique and probably different name when used. - +
Alias injection names @@ -394,7 +391,7 @@ List pusList = query.setString("name", "Pus%").list(); -
+
Named SQL queries Named SQL queries can also be defined in the mapping document and @@ -550,7 +547,7 @@ List pusList = query.setString("name", "Pus%").list(); . - + Named SQL query using <classname>@NamedNativeQuery</classname> together with <classname>@SqlResultSetMapping</classname> @@ -574,7 +571,7 @@ List pusList = query.setString("name", "Pus%").list(); - + Implicit result set mapping @Entity @@ -616,7 +613,7 @@ public class SpaceShip { } - + Using dot notation in @FieldResult for specifying associations @@ -747,7 +744,7 @@ public class SpaceShip { org.hibernate.callable which can be true or false depending on whether the query is a stored procedure or not. -
+
Using return-property to explicitly specify column/alias names @@ -800,7 +797,7 @@ public class SpaceShip { discriminator column.
-
+
Using stored procedures for querying Hibernate3 provides support for queries via stored procedures and @@ -845,7 +842,7 @@ BEGIN <return-join> and <load-collection> are not supported. -
+
Rules/limitations for using stored procedures You cannot use stored procedures with Hibernate unless you @@ -898,7 +895,7 @@ BEGIN
-
+
Custom SQL for create, update and delete Hibernate3 can use custom SQL for create, update, and delete @@ -936,7 +933,7 @@ public class Chaos { <sql-delete> nodes. This can be seen in . - + Custom CRUD XML <class name="Person"> @@ -981,7 +978,7 @@ public class Chaos { to override the collection related statements -see . - + Overriding SQL statements for collections using annotations @@ -1057,7 +1054,7 @@ END updatePerson;
-
+
Custom SQL for loading You can also declare your own SQL (or HQL) queries for entity diff --git a/documentation/src/main/docbook/devguide/en-US/chapters/query_ql/HQL_JPQL.xml b/documentation/src/main/docbook/devguide/en-US/chapters/query_ql/HQL_JPQL.xml index 30d20426a7..5aaf71c6ae 100644 --- a/documentation/src/main/docbook/devguide/en-US/chapters/query_ql/HQL_JPQL.xml +++ b/documentation/src/main/docbook/devguide/en-US/chapters/query_ql/HQL_JPQL.xml @@ -1,9 +1,8 @@ - -%BOOK_ENTITIES; -]> - + + + HQL and JPQL @@ -64,7 +63,7 @@ The BNF for SELECT statements in HQL is: - + The simplest possible HQL SELECT statement is of the form: @@ -86,7 +85,7 @@ The BNF for UPDATE statements is the same in HQL and JPQL: - + UPDATE statements, by default, do not effect the version or the timestamp attribute values for the affected entities. However, @@ -112,9 +111,9 @@ Example UPDATE query statements - - - + + +
@@ -130,7 +129,7 @@ The BNF for DELETE statements is the same in HQL and JPQL: - + A DELETE statement is also executed using the executeUpdate method of either org.hibernate.Query or @@ -144,7 +143,7 @@ HQL adds the ability to define INSERT statements as well. There is no JPQL equivalent to this. The BNF for an HQL INSERT statement is: - + The attribute_list is analogous to the column specification in the SQL INSERT statement. For entities involved in mapped inheritance, only attributes @@ -179,7 +178,7 @@ Example INSERT query statements - +
@@ -223,10 +222,10 @@ The BNF for a root entity reference is: - + Simple query example - + We see that the query is defining a root entity reference to the com.acme.Cat @@ -240,15 +239,15 @@ Simple query using entity name for root entity reference - + Multiple root entity references can also be specified. Even naming the same entity! Simple query using multiple root entity references - - + +
@@ -260,11 +259,11 @@ Explicit inner join examples - + Explicit left (outer) join examples - + An important use case for explicit joins is to define FETCH JOINS which override @@ -273,7 +272,7 @@ Fetch join example - + As you can see from the example, a fetch join is specified by injecting the keyword fetch @@ -304,7 +303,7 @@ with-clause join example - + The important distinction is that in the generated SQL the conditions of the @@ -329,7 +328,7 @@ Simple implicit join example - + An implicit join always starts from an identification variable, followed by @@ -343,7 +342,7 @@ - If the attribute represents an entity association (non-collection) or a coponent/embedded, that + If the attribute represents an entity association (non-collection) or a component/embedded, that reference can be further navigated. Basic values and collection-valued associations cannot be further navigated. @@ -355,7 +354,7 @@ Reused implicit join - + Just as with explicit joins, implicit joins may reference association or component/embedded attributes. @@ -374,7 +373,7 @@ Collection references example - + In the example, the identification variable o actually refers to the object model @@ -395,7 +394,7 @@ Qualified collection references example - + @@ -504,7 +503,7 @@ String literal examples - + @@ -512,7 +511,7 @@ Numeric literal examples - + In the scientific notation form, the E is case insensitive. @@ -558,7 +557,7 @@ Named parameter examples - +
@@ -570,7 +569,7 @@ Positional (JPQL) parameter examples - +
@@ -593,7 +592,7 @@ Numeric arithmetic examples - + The following rules apply to the result of arithmetic operations: @@ -651,7 +650,7 @@ Concatenation operation example - + See for details on the concat() function @@ -697,7 +696,7 @@ Aggregate function examples - + Aggregations often appear with grouping. For information on grouping see @@ -734,7 +733,7 @@ Extracts a portion of a string value. - + The second argument denotes the starting position. The third (optional) argument denotes the length. @@ -779,7 +778,7 @@ Locates a string within another string. - + The third argument (optional) is used to denote a position from which to start looking. @@ -1018,14 +1017,14 @@ Collection-related expressions examples - + Elements of indexed collections (arrays, lists, and maps) can be referred to by index operator. Index operator examples - + See also as there is a good deal of overlap. @@ -1044,7 +1043,7 @@ Entity type expression examples - + HQL also has a legacy form of referring to an entity type, though that legacy form is considered @@ -1064,10 +1063,10 @@ The simple form has the following syntax: - + Simple case expression example - +
@@ -1075,10 +1074,10 @@ The searched form has the following syntax: - + Searched case expression example - +
@@ -1088,7 +1087,7 @@ NULLIF example - +
@@ -1118,7 +1117,7 @@ Dynamic instantiation example - constructor - + @@ -1137,7 +1136,7 @@ Dynamic instantiation example - list - + The results from this query will be a ]]> as opposed to a ]]> @@ -1148,7 +1147,7 @@ Dynamic instantiation example - map - + The results from this query will be a >]]> as opposed to a @@ -1175,7 +1174,7 @@ Relational comparison examples - + Comparisons can also involve subquery qualifiers - ALL, ANY, @@ -1187,7 +1186,7 @@ ALL subquery comparison qualifier example - + The ANY/SOME qualifier resolves to true if the comparison is true for some of (at least one of) the @@ -1203,7 +1202,7 @@ Nullness checking examples - +
@@ -1212,7 +1211,7 @@ Performs a like comparison on string values. The syntax is: - + The semantics follow that of the SQL like expression. The pattern_value is the pattern to attempt to match in the string_expression. Just like SQL, @@ -1228,7 +1227,7 @@ Like predicate examples - +
@@ -1240,7 +1239,7 @@ Between predicate examples - +
@@ -1250,7 +1249,7 @@ IN predicates performs a check that a particular value is in a list of values. Its syntax is: - + The types of the single_valued_expression and the individual values in the single_valued_list must be consistent. JPQL limits the valid types here @@ -1285,7 +1284,7 @@ In predicate examples - +
@@ -1306,7 +1305,7 @@ Empty collection expression examples - +
@@ -1318,7 +1317,7 @@ Member-of collection expression examples - + @@ -1367,7 +1366,7 @@ Group-by illustration - + The first query retrieves the complete total of all orders. The second retrieves the total for each @@ -1383,7 +1382,7 @@ Having illustration - + The HAVING clause follows the same rules as the WHERE clause and is also made up of predicates. HAVING is @@ -1432,7 +1431,7 @@ Order-by examples - + diff --git a/documentation/src/main/docbook/devguide/en-US/chapters/services/Services.xml b/documentation/src/main/docbook/devguide/en-US/chapters/services/Services.xml index f86a7d86ef..39087e241b 100644 --- a/documentation/src/main/docbook/devguide/en-US/chapters/services/Services.xml +++ b/documentation/src/main/docbook/devguide/en-US/chapters/services/Services.xml @@ -1,10 +1,8 @@ - -%BOOK_ENTITIES; -]> - + + Services
@@ -71,7 +69,7 @@
-
+
ServiceRegistry The central service API, aside from the services themselves, is the @@ -92,7 +90,7 @@
Standard services -
+
<interfacename>org.hibernate.engine.jdbc.batch.spi.BatchBuilder</interfacename> @@ -122,7 +120,7 @@
-
+
<interfacename>org.hibernate.service.config.spi.ConfigurationService</interfacename> @@ -154,7 +152,7 @@
-
+
<interfacename>org.hibernate.service.jdbc.connections.spi.ConnectionProvider</interfacename> @@ -217,7 +215,7 @@
-
+
<interfacename>org.hibernate.service.jdbc.dialect.spi.DialectFactory</interfacename> @@ -250,7 +248,7 @@
-
+
<interfacename>org.hibernate.service.jdbc.dialect.spi.DialectResolver</interfacename> @@ -289,7 +287,7 @@
-
+
<interfacename>org.hibernate.engine.jdbc.spi.JdbcServices</interfacename> @@ -320,7 +318,7 @@
-
+
<interfacename>org.hibernate.service.jmx.spi.JmxService</interfacename> @@ -361,7 +359,7 @@
-
+
<interfacename>org.hibernate.service.jndi.spi.JndiService</interfacename> @@ -391,7 +389,7 @@
-
+
<interfacename>org.hibernate.service.jta.platform.spi.JtaPlatform</interfacename> @@ -531,7 +529,7 @@
-
+
<interfacename>org.hibernate.service.jdbc.connections.spi.MultiTenantConnectionProvider</interfacename> @@ -562,7 +560,7 @@
-
+
<interfacename>org.hibernate.persister.spi.PersisterClassResolver</interfacename> @@ -595,7 +593,7 @@
-
+
<interfacename>org.hibernate.persister.spi.PersisterFactory</interfacename> @@ -628,7 +626,7 @@
-
+
<interfacename>org.hibernate.cache.spi.RegionFactory</interfacename> @@ -682,7 +680,7 @@
-
+
<interfacename>org.hibernate.service.spi.SessionFactoryServiceRegistryFactory</interfacename> @@ -717,7 +715,7 @@
-
+
<interfacename>org.hibernate.stat.Statistics</interfacename> @@ -760,7 +758,7 @@
-
+
<interfacename>org.hibernate.engine.transaction.spi.TransactionFactory</interfacename> @@ -822,7 +820,7 @@
-
+
<interfacename>org.hibernate.tool.hbm2ddl.ImportSqlCommandExtractor</interfacename> @@ -910,7 +908,7 @@
Special service registries -
+
Boot-strap registry The boot-strap registry holds services that absolutely have to be available for most things to work. @@ -924,9 +922,9 @@ org.hibernate.service.BootstrapServiceRegistryBuilder class. - + Using BootstrapServiceRegistryBuilder - +
@@ -975,7 +973,7 @@
-
+
<interfacename>org.hibernate.integrator.spi.IntegratorService</interfacename> Applications, add-ons and others all need to integrate with Hibernate which used to require @@ -1002,7 +1000,7 @@
-
+
SessionFactory registry While it is best practice to treat instances of all the registry types as targeting a given @@ -1013,7 +1011,7 @@ org.hibernate.service.spi.SessionFactoryServiceRegistry -
+
<interfacename>org.hibernate.event.service.spi.EventListenerRegistry</interfacename> @@ -1047,14 +1045,14 @@
-
+
Using services and registries Coming soon...
-
+
Integrators The org.hibernate.integrator.spi.Integrator is intended to provide a simple @@ -1081,7 +1079,7 @@ See -
+
Integrator use-cases The main use cases for an org.hibernate.integrator.spi.Integrator right @@ -1091,7 +1089,7 @@ relational models. - + Registering event listeners diff --git a/documentation/src/main/docbook/devguide/en-US/chapters/transactions/Transactions.xml b/documentation/src/main/docbook/devguide/en-US/chapters/transactions/Transactions.xml index 49583a602c..4f90252ed9 100644 --- a/documentation/src/main/docbook/devguide/en-US/chapters/transactions/Transactions.xml +++ b/documentation/src/main/docbook/devguide/en-US/chapters/transactions/Transactions.xml @@ -1,9 +1,8 @@ - -%BOOK_ENTITIES; -]> - + + + Transactions and concurrency control
@@ -191,21 +190,21 @@ org.hibernate.Session acts as a transaction-scoped cache providing repeatable reads for lookup by identifier and queries that result in loading entities. -
- - - To reduce lock contention in the database, the physical database transaction needs to be as short as - possible. Long database transactions prevent your application from scaling to a highly-concurrent load. - Do not hold a database transaction open during end-user-level work, but open it after the end-user-level - work is finished. This is concept is referred to as transactional write-behind. - - + + + To reduce lock contention in the database, the physical database transaction needs to be as short as + possible. Long database transactions prevent your application from scaling to a highly-concurrent load. + Do not hold a database transaction open during end-user-level work, but open it after the end-user-level + work is finished. This is concept is referred to as transactional write-behind. + + +
Transactional patterns (and anti-patterns) -
+
Session-per-operation anti-pattern This is an anti-pattern of opening and closing a Session for each database call @@ -226,7 +225,7 @@
-
+
Session-per-request pattern This is the most common transaction pattern. The term request here relates to the concept of a system @@ -307,7 +306,7 @@
-
+
Conversations The session-per-request pattern is not the only valid way of designing units of work. @@ -416,6 +415,9 @@
Session-per-application + + Discussion coming soon.. +
@@ -429,11 +431,11 @@ Database identity - + JVM identity - + For objects attached to a particular Session, the two notions are @@ -470,7 +472,7 @@
-
+
Common issues diff --git a/documentation/src/main/docbook/manual/en-US/Book_Info.xml b/documentation/src/main/docbook/manual/en-US/Book_Info.xml deleted file mode 100644 index ea1aaa8ad9..0000000000 --- a/documentation/src/main/docbook/manual/en-US/Book_Info.xml +++ /dev/null @@ -1,52 +0,0 @@ - - -%BOOK_ENTITIES; -]> - - - HIBERNATE - Relational Persistence for Idiomatic Java - Hibernate Reference Documentation - &version; - 1.0 - 1 - JBoss Hibernate Core - &version; - &today; - 1 - - - - - - - - - - ©rightYear; - ©rightHolder; - - - - - - - - - - - - diff --git a/documentation/src/main/docbook/manual/en-US/HIBERNATE_-_Relational_Persistence_for_Idiomatic_Java.xml b/documentation/src/main/docbook/manual/en-US/HIBERNATE_-_Relational_Persistence_for_Idiomatic_Java.xml index aa0b10a713..1ed5fb1ed4 100644 --- a/documentation/src/main/docbook/manual/en-US/HIBERNATE_-_Relational_Persistence_for_Idiomatic_Java.xml +++ b/documentation/src/main/docbook/manual/en-US/HIBERNATE_-_Relational_Persistence_for_Idiomatic_Java.xml @@ -1,47 +1,17 @@ - %BOOK_ENTITIES; ]> - - - - diff --git a/documentation/src/main/docbook/manual/en-US/content/additionalmodules.xml b/documentation/src/main/docbook/manual/en-US/content/additionalmodules.xml index 994630dad9..ac26b01edc 100644 --- a/documentation/src/main/docbook/manual/en-US/content/additionalmodules.xml +++ b/documentation/src/main/docbook/manual/en-US/content/additionalmodules.xml @@ -1,30 +1,7 @@ - - - + + + Additional modules Hibernate Core also offers integration with some external @@ -250,9 +227,10 @@ These constraints can be declared directly on the entity properties or indirectly by using constraint composition. - For more information check the Hibernate Validator reference - documentation. + + For more information check the Hibernate Validator reference documentation at + +
@@ -262,16 +240,16 @@
Description - Full text search engines like Apache - Lucene are a very powerful technology to bring free - text/efficient queries to applications. If suffers several mismatches - when dealing with a object domain model (keeping the index up to date, - mismatch between the index structure and the domain model, querying - mismatch...) Hibernate Search indexes your domain model thanks to a few - annotations, takes care of the database / index synchronization and - brings you back regular managed objects from free text queries. - Hibernate Search is using Apache - Lucene under the cover. + + Full text search engines like Apache Lucene are a very powerful technology to + bring free text/efficient queries to applications. If suffers several mismatches when dealing with a + object domain model (keeping the index up to date, mismatch between the index structure and the domain + model, querying mismatch...) Hibernate Search indexes your domain model thanks to a few annotations, + takes care of the database / index synchronization and brings you back regular managed objects from + free text queries. Hibernate Search is using + Apache Lucene + under the covers. +
@@ -284,9 +262,11 @@ hibernate.search.autoregister_listeners to false. Such a need is very uncommon and not recommended. - Check the Hibernate Search reference - documentation for more information. + + Check the Hibernate Search reference documentation ( + + ) for more information. +
diff --git a/documentation/src/main/docbook/manual/en-US/content/architecture.xml b/documentation/src/main/docbook/manual/en-US/content/architecture.xml index 38a9800ab1..badbe12b52 100644 --- a/documentation/src/main/docbook/manual/en-US/content/architecture.xml +++ b/documentation/src/main/docbook/manual/en-US/content/architecture.xml @@ -1,39 +1,11 @@ - + - -%BOOK_ENTITIES; - -]> - - + Architecture -
+
Overview @@ -55,7 +27,7 @@ illustrate 2 specifically since they are extremes. -
+
Minimal architecture @@ -73,7 +45,7 @@
-
+
Comprehensive architecture @@ -90,7 +62,7 @@
-
+
Basic APIs Here are quick discussions about some of the API objects depicted in the preceding diagrams (you will @@ -196,7 +168,7 @@
-
+
JMX Integration @@ -211,7 +183,7 @@
-
+
Contextual sessions Most applications using Hibernate need some form of "contextual" session, where a given diff --git a/documentation/src/main/docbook/manual/en-US/content/association_mapping.xml b/documentation/src/main/docbook/manual/en-US/content/association_mapping.xml index c20534ba6a..a3e7f64696 100755 --- a/documentation/src/main/docbook/manual/en-US/content/association_mapping.xml +++ b/documentation/src/main/docbook/manual/en-US/content/association_mapping.xml @@ -1,35 +1,7 @@ - + - -%BOOK_ENTITIES; - -]> - - + Association Mappings @@ -58,10 +30,10 @@
-
+
Unidirectional associations -
+
Many-to-one @@ -90,7 +62,7 @@ create table Address ( addressId bigint not null primary key )
-
+
One-to-one @@ -145,7 +117,7 @@ create table Address ( personId bigint not null primary key )
-
+
One-to-many @@ -182,10 +154,10 @@ create table Address ( addressId bigint not null primary key, personId bigint no
-
+
Unidirectional associations with join tables -
+
One-to-many @@ -219,7 +191,7 @@ create table Address ( addressId bigint not null primary key )
-
+
Many-to-one @@ -253,7 +225,7 @@ create table Address ( addressId bigint not null primary key )
-
+
One-to-one @@ -289,7 +261,7 @@ create table Address ( addressId bigint not null primary key )
-
+
Many-to-many @@ -322,10 +294,10 @@ create table Address ( addressId bigint not null primary key )
-
+
Bidirectional associations -
+
one-to-many / many-to-one @@ -398,7 +370,7 @@ create table Address ( addressId bigint not null primary key )
-
+
One-to-one @@ -458,10 +430,10 @@ create table Address ( personId bigint not null primary key )
-
+
Bidirectional associations with join tables -
+
one-to-many / many-to-one @@ -504,7 +476,7 @@ create table Address ( addressId bigint not null primary key )
-
+
one to one @@ -550,7 +522,7 @@ create table Address ( addressId bigint not null primary key )
-
+
Many-to-many @@ -589,7 +561,7 @@ create table Address ( addressId bigint not null primary key )
-
+
More complex association mappings diff --git a/documentation/src/main/docbook/manual/en-US/content/basic_mapping.xml b/documentation/src/main/docbook/manual/en-US/content/basic_mapping.xml index 7cd200df2d..e9ef47b38b 100644 --- a/documentation/src/main/docbook/manual/en-US/content/basic_mapping.xml +++ b/documentation/src/main/docbook/manual/en-US/content/basic_mapping.xml @@ -1,36 +1,10 @@ - - -%BOOK_ENTITIES; -]> - + + + Basic O/R Mapping -
+
Mapping declaration Object/relational mappings can be defined in three @@ -210,7 +184,7 @@ public class Dog { ... } affect the database schemas exported by the schema export tool (for example, the not-null attribute). -
+
Entity An entity is a regular Java object (aka POJO) which will be @@ -432,47 +406,47 @@ public class Summary { - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + <class @@ -494,7 +468,7 @@ public class Summary { lazy="true|false" entity-name="EntityName" check="arbitrary sql check condition" - rowid="rowid" + rowxml:id="rowid" subselect="SQL expression" abstract="true|false" node="element-name" @@ -670,7 +644,7 @@ public class Summary { attribute and a nested mapping element.
-
+
Identifiers Mapped classes must declare the primary key @@ -692,15 +666,15 @@ public class Person { - + - + - + - + - + <id @@ -1234,7 +1208,7 @@ class UserId implements Serializable {
-
+
Identifier generator Hibernate can generate and populate identifier values for you @@ -1519,7 +1493,7 @@ public String getId() { hilo - uses a hi/lo algorithm to efficiently generate identifiers of type long, short or int, given a @@ -1611,10 +1585,9 @@ public String getId() { mac address and integrating it via the org.hibernate.id.UUIDGenerationStrategy contract. Two such libraries known at time of this - writing include http://johannburkard.de/software/uuid/ - and http://commons.apache.org/sandbox/id/uuid.html + writing include + and + @@ -1690,7 +1663,7 @@ public String getId() {
-
+
Hi/lo algorithm The hilo and seqhilo @@ -1721,7 +1694,7 @@ public String getId() { hibernate.transaction.manager_lookup_class.
-
+
UUID algorithm The UUID contains: IP address, startup time of the JVM that is @@ -1731,7 +1704,7 @@ public String getId() { using JNI.
-
+
Identity columns and sequences For databases that support identity columns (DB2, MySQL, @@ -1759,7 +1732,7 @@ public String getId() { strategies.
-
+
Assigned identifiers If you want the application to assign identifiers, as opposed @@ -1778,7 +1751,7 @@ public String getId() { define Interceptor.isUnsaved().
-
+
Primary keys assigned by triggers Hibernate does not generate DDL with triggers. It is for @@ -1846,7 +1819,7 @@ class Person {
-
+
Enhanced identifier generators Starting with release 3.2.3, there are 2 new generators which @@ -1982,7 +1955,7 @@ class Person { -
+
Identifier generator optimization For identifier generators that store values in the database, @@ -2091,7 +2064,7 @@ public class Customer implements Serializable { especially useful for people using assigned identifiers or composite keys. -
+
Version number You can add optimistic locking capability to an entity using the @@ -2128,19 +2101,19 @@ public class Flight implements Serializable { - + - + - + - + - + - + - + <version @@ -2207,7 +2180,7 @@ public class Flight implements Serializable {
-
+
Timestamp Alternatively, you can use a timestamp. Timestamps are a less @@ -2245,17 +2218,17 @@ public class Flight implements Serializable { - + - + - + - + - + - + <timestamp @@ -2331,7 +2304,7 @@ public class Flight implements Serializable {
-
+
Property You need to decide which property needs to be made persistent in a @@ -2678,7 +2651,7 @@ public class Order { require acquisition of the optimistic lock.
-
+
Declaring column attributes The column(s) used for a property mapping can be defined using @@ -2728,25 +2701,25 @@ public String getName() { ... } - + - + - + - + - + - + - + - + - + - + @Column( @@ -2801,17 +2774,17 @@ public String getName() { ... } - length (optional): + length (optional): column length (default 255) - precision + precision (optional): column decimal precision (default 0) - scale (optional): + scale (optional): column decimal scale if useful (default 0) @@ -2875,31 +2848,31 @@ public long getObjectVolume() - + - + - + - - + + - + - + - + - + - + - + - + - + <property @@ -3065,7 +3038,7 @@ public long getObjectVolume()
-
+
Embedded objects (aka components) Embeddable objects (or components) are objects whose properties @@ -3176,21 +3149,21 @@ public class Country implements Serializable { - + - + - + - + - + - + - + - + <component @@ -3302,7 +3275,7 @@ public class Country implements Serializable { -
+
Single table per class hierarchy strategy With this approach the properties of all the subclasses in a @@ -3333,13 +3306,13 @@ public class A320 extends Plane { ... } - + - + - + - + <subclass @@ -3386,7 +3359,7 @@ public class A320 extends Plane { ... } For information about inheritance mappings see . -
+
Discriminator Discriminators are required for polymorphic persistence using @@ -3465,15 +3438,15 @@ public class A320 extends Plane { ... } - + - + - + - + - + <discriminator @@ -3535,7 +3508,7 @@ public class A320 extends Plane { ... }
-
+
Joined subclass strategy Each subclass can also be mapped to its own table. This is @@ -3577,13 +3550,13 @@ public class DomesticCat extends Cat { - + - + - + - + <joined-subclass @@ -3672,7 +3645,7 @@ public class DomesticCat extends Cat { linkend="inheritance" />.
-
+
Table per class strategy A third option is to map only the concrete classes of an @@ -3692,13 +3665,13 @@ public class Flight implements Serializable { ... } - + - + - + - + <union-subclass @@ -3862,7 +3835,7 @@ public class Plane extends FlyingObject { inherit them.
-
+
Mapping one entity to several tables While not recommended for a fresh schema, some legacy databases @@ -3997,17 +3970,17 @@ public class Cat implements Serializable { - + - + - + - + - + - + <join @@ -4163,7 +4136,7 @@ public class Cat implements Serializable { overrides any lazy attribute (an association loaded through a JOIN strategy cannot be lazy). -
+
Using a foreign key or an association table An ordinary association to another persistent class is declared @@ -4352,39 +4325,39 @@ class Home { - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + <many-to-one @@ -4562,7 +4535,7 @@ class Home { <many-to-one name="owner" property-ref="identity.ssn" column="OWNER_SSN"/>
-
+
Sharing the primary key with the associated entity The second approach is to ensure an entity and its associated @@ -4605,25 +4578,25 @@ public class Heart { - + - + - + - + - + - + - + - + - + - + <one-to-one @@ -4754,7 +4727,7 @@ public class Heart {
-
+
Natural-id Although we recommend the use of surrogate keys as primary keys, @@ -4814,7 +4787,7 @@ List results = s.createCriteria( Citizen.class )
-
+
Any There is one more type of property mapping. The @@ -4889,17 +4862,17 @@ package org.hibernate.test.annotations.any; - + - + - + - + - + - + <any @@ -4955,7 +4928,7 @@ package org.hibernate.test.annotations.any;
-
+
Properties The <properties> element allows the @@ -4967,15 +4940,15 @@ package org.hibernate.test.annotations.any; - + - + - + - + - + <properties @@ -5085,7 +5058,7 @@ class Home { The hbm.xml structure has some specificities naturally not present when using annotations, let's describe them briefly. -
+
Doctype All XML mappings should declare the doctype shown. The actual @@ -5096,7 +5069,7 @@ class Home { an Internet connection, check the DTD declaration against the contents of your classpath. -
+
EntityResolver Hibernate will first attempt to resolve DTDs in its classpath. @@ -5139,7 +5112,7 @@ class Home {
-
+
Hibernate-mapping This element has several optional attributes. The @@ -5156,19 +5129,19 @@ class Home { - + - + - + - + - + - + - + <hibernate-mapping @@ -5241,8 +5214,8 @@ class Home { Animal.hbm.xml.
-
- Key +
+ Key The <key> element is featured a few times within this guide. It appears anywhere the parent mapping @@ -5252,17 +5225,17 @@ class Home { - + - + - + - + - + - + <key @@ -5329,7 +5302,7 @@ class Home { not-null="true">.
-
+
Import If your application has two persistent classes with the same @@ -5342,9 +5315,9 @@ class Home { - + - + <import @@ -5372,7 +5345,7 @@ class Home {
-
+
Column and formula elements Mapping elements which accept a column @@ -5419,10 +5392,10 @@ class Home {
-
+
Hibernate types -
+
Entities and values In relation to the persistence service, Java language-level @@ -5481,7 +5454,7 @@ class Home { support null semantics.
-
+
Basic value types The built-in basic mapping types can be @@ -5673,7 +5646,7 @@ class Home { string type.
-
+
Custom value types It is relatively easy for developers to create their own value @@ -5753,7 +5726,7 @@ class Home {
-
+
Mapping a class more than once It is possible to provide more than one mapping for a particular @@ -5790,7 +5763,7 @@ class Home {
-
+
SQL quoted identifiers You can force Hibernate to quote an identifier in the generated SQL @@ -5812,7 +5785,7 @@ class LineItem { </class>
-
+
Generated properties Generated properties are properties that have their values generated @@ -5848,7 +5821,7 @@ class LineItem { @Generated.
-
+
Column transformers: read and write expressions Hibernate allows you to customize the SQL it uses to read and write @@ -5920,7 +5893,7 @@ class User { exactly one '?' placeholder for the value.
-
+
Auxiliary database objects Auxiliary database objects allow for the CREATE and DROP of diff --git a/documentation/src/main/docbook/manual/en-US/content/batch.xml b/documentation/src/main/docbook/manual/en-US/content/batch.xml index f5b375b02c..018e5bb621 100755 --- a/documentation/src/main/docbook/manual/en-US/content/batch.xml +++ b/documentation/src/main/docbook/manual/en-US/content/batch.xml @@ -1,35 +1,7 @@ - + - -%BOOK_ENTITIES; - -]> - - + Batch processing @@ -62,7 +34,7 @@ session.close();]]> - + Hibernate disables insert batching at the JDBC level transparently if you use an identity identifier generator. @@ -79,7 +51,7 @@ session.close();]]> CacheMode to disable interaction with the second-level cache. -
+
Batch inserts @@ -106,7 +78,7 @@ session.close();]]>
-
+
Batch updates @@ -137,7 +109,7 @@ session.close();]]>
-
+
The StatelessSession interface Alternatively, Hibernate provides a command-oriented API that can be used for @@ -186,7 +158,7 @@ session.close();]]>
-
+
DML-style operations diff --git a/documentation/src/main/docbook/manual/en-US/content/best_practices.xml b/documentation/src/main/docbook/manual/en-US/content/best_practices.xml index bee8235966..1d94e4b60e 100644 --- a/documentation/src/main/docbook/manual/en-US/content/best_practices.xml +++ b/documentation/src/main/docbook/manual/en-US/content/best_practices.xml @@ -1,35 +1,7 @@ - + - -%BOOK_ENTITIES; - -]> - - + Best Practices diff --git a/documentation/src/main/docbook/manual/en-US/content/bibliography.xml b/documentation/src/main/docbook/manual/en-US/content/bibliography.xml index 0c2cfecf38..708440f93a 100644 --- a/documentation/src/main/docbook/manual/en-US/content/bibliography.xml +++ b/documentation/src/main/docbook/manual/en-US/content/bibliography.xml @@ -1,44 +1,19 @@ - - -%BOOK_ENTITIES; - -]> + References - + PoEAA Patterns of Enterprise Application Architecture - 0-321-12742-0 + 0-321-12742-0 - Martin - Fowler + + Martin + Fowler + @@ -50,22 +25,26 @@ - + JPwH Java Persistence with Hibernate Second Edition of Hibernate in Action - 1-932394-88-5 + 1-932394-88-5 - + - Christian - Bauer + + Christian + Bauer + - Gavin - King + + Gavin + King + diff --git a/documentation/src/main/docbook/manual/en-US/content/collection_mapping.xml b/documentation/src/main/docbook/manual/en-US/content/collection_mapping.xml index 0a4e9c0faa..78d0c2b85c 100644 --- a/documentation/src/main/docbook/manual/en-US/content/collection_mapping.xml +++ b/documentation/src/main/docbook/manual/en-US/content/collection_mapping.xml @@ -1,36 +1,10 @@ - - -%BOOK_ENTITIES; -]> - + + + Collection mapping -
+
Persistent collections Naturally Hibernate also allows to persist collections. These @@ -102,7 +76,7 @@ kittens = cat.getKittens(); // Okay, kittens collection is a Set
-
+
How to map collections Using annotations you can map Collections, @@ -112,7 +86,7 @@ kittens = cat.getKittens(); // Okay, kittens collection is a Set @ElementCollection. In the simplest case a collection mapping looks like this: - + Collection mapping using @OneToMany and @JoinColumn @Entity @@ -143,9 +117,8 @@ public class Part { also use a join table as seen in . - - Collection mapping using - @OneToMany and @JoinTable + + Collection mapping using @OneToMany and @JoinTable @Entity public class Product { @@ -191,7 +164,7 @@ public class Part { <set> element is used for mapping properties of type Set. - + Mapping a Set using <set> <class name="Product"> @@ -230,11 +203,11 @@ public class Part { - + - + - + <one-to-many @@ -295,33 +268,33 @@ public class Part { - + - + - + - + - + - + - + - + - + - + - + - + - + - + <map @@ -448,7 +421,7 @@ public class Part { paragraphs we will now focus details like physical mapping considerations, indexed collections and collections of value types. -
+
Collection foreign keys On the database level collection instances are distinguished by @@ -479,12 +452,12 @@ public class Part { @OnDelete(action=OnDeleteAction.CASCADE) - See for more information + See for more information about the <key> element.
-
- Indexed collections +
+ Indexed collections In the following paragraphs we have a closer at the indexed collections List and Map @@ -633,9 +606,9 @@ public class Order { - + - + <list-index @@ -825,11 +798,11 @@ public class Order { - + - + - + <map-key @@ -863,11 +836,11 @@ public class Order { - + - + - + <map-key-many-to-many @@ -897,7 +870,7 @@ public class Order {
-
+
Collections of basic types and embeddable objects In some situations you don't need to associate two entities but @@ -996,11 +969,11 @@ public class User { - + - + - + <element @@ -1036,11 +1009,11 @@ public class User {
-
+
Advanced collection mappings -
- Sorted collections +
+ Sorted collections Hibernate supports collections implementing java.util.SortedMap and @@ -1132,7 +1105,7 @@ public SortedSet<Ticket> getTickets() {
-
+
Bidirectional associations A bidirectional association allows navigation @@ -1379,7 +1352,7 @@ public class Customer { category can have many items and each item can be in many categories: - + Many to many association using Hibernate mapping files <class name="Category"> @@ -1425,7 +1398,7 @@ session.persist(category); // The relationship will be saved
-
+
Bidirectional associations with indexed collections There are some additional considerations for bidirectional @@ -1500,7 +1473,7 @@ session.persist(category); // The relationship will be saved
-
+
Ternary associations There are three possible approaches to mapping a ternary @@ -1534,7 +1507,7 @@ public class Company { composite elements, which will be discussed later.
-
+
<literal>Using an <idbag></literal> The majority of the many-to-many associations and collections of @@ -1576,7 +1549,7 @@ public class Company { - -
+
Collection examples This section covers collection examples. diff --git a/documentation/src/main/docbook/manual/en-US/content/component_mapping.xml b/documentation/src/main/docbook/manual/en-US/content/component_mapping.xml index a347e53330..cf2ed6343a 100644 --- a/documentation/src/main/docbook/manual/en-US/content/component_mapping.xml +++ b/documentation/src/main/docbook/manual/en-US/content/component_mapping.xml @@ -1,35 +1,7 @@ - + - -%BOOK_ENTITIES; - -]> - - + Component Mapping @@ -37,7 +9,7 @@ throughout Hibernate. -
+
Dependent objects @@ -163,7 +135,7 @@
-
+
Collections of dependent objects @@ -264,7 +236,7 @@
-
+
Components as Map indices @@ -275,7 +247,7 @@
-
+
Components as composite identifiers @@ -415,7 +387,7 @@
-
+
Dynamic components diff --git a/documentation/src/main/docbook/manual/en-US/content/configuration.xml b/documentation/src/main/docbook/manual/en-US/content/configuration.xml index 0cc87eea0a..9442bd2663 100644 --- a/documentation/src/main/docbook/manual/en-US/content/configuration.xml +++ b/documentation/src/main/docbook/manual/en-US/content/configuration.xml @@ -1,33 +1,7 @@ - - -%BOOK_ENTITIES; -]> - + + + Configuration Hibernate is designed to operate in many different environments and, @@ -37,7 +11,7 @@ etc/ that displays the various options. Simply put the example file in your classpath and customize it to suit your needs. -
+
Programmatic configuration An instance of @@ -114,7 +88,7 @@ SessionFactory is created.
-
+
Obtaining a SessionFactory When all mappings have been parsed by the @@ -130,7 +104,7 @@ useful if you are using more than one database.
-
+
JDBC connections It is advisable to have the @@ -320,7 +294,7 @@ hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect hibernate.connection.provider_class property.
-
+
Optional configuration properties There are a number of other properties that control the behavior of @@ -336,7 +310,7 @@ hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect above. -
+
Hibernate Configuration Properties @@ -503,7 +477,7 @@ hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect databases (if a sequence or a table is used for id generation). -
+
Hibernate JDBC and Connection Properties @@ -666,7 +640,7 @@ hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect
- +
Hibernate Cache Properties @@ -761,7 +735,7 @@ hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect
- Hibernate Transaction Properties @@ -835,7 +809,7 @@ hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect
- +
Miscellaneous Properties @@ -955,7 +929,7 @@ hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect
-
+
SQL Dialects Always set the hibernate.dialect property to @@ -964,7 +938,7 @@ hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect defaults for some of the other properties listed above. This means that you will not have to specify them manually. - +
Hibernate SQL Dialects (<literal>hibernate.dialect</literal>) @@ -1149,7 +1123,7 @@ hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect
-
+
Outer Join Fetching If your database supports ANSI, Oracle or Sybase style outer @@ -1171,7 +1145,7 @@ hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect information.
-
+
Binary Streams Oracle limits the size of byte arrays that can @@ -1182,7 +1156,7 @@ hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect is a system-level setting only.
-
+
Second-level and query cache The properties prefixed by hibernate.cache @@ -1191,7 +1165,7 @@ hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect information.
-
+
Query Language Substitution You can define new Hibernate query tokens using @@ -1209,7 +1183,7 @@ hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect function.
-
+
Hibernate statistics If you enable hibernate.generate_statistics, @@ -1221,18 +1195,26 @@ hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect
-
+
Logging - Hibernate utilizes Simple Logging - Facade for Java (SLF4J) in order to log various system events. + + + Completely out of date. Hibernate uses JBoss Logging starting in 4.0. + This will get documented as we migrate this content to the Developer Guide. + + + + Hibernate utilizes Simple Logging + Facade for Java (SLF4J) in order to log various system events. SLF4J can direct your logging output to several logging frameworks (NOP, Simple, log4j version 1.2, JDK 1.4 logging, JCL or logback) depending on your chosen binding. In order to setup logging you will need slf4j-api.jar in your classpath together with the jar file for your preferred binding - slf4j-log4j12.jar - in the case of Log4J. See the SLF4J documentation for more + in the case of Log4J. See the SLF4J + documentation + for more detail. To use Log4j you will also need to place a log4j.properties file in your classpath. An example properties file is distributed with Hibernate in the @@ -1244,7 +1226,7 @@ hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect troubleshooting device. The most interesting log categories are the following: - +
Hibernate Log Categories @@ -1332,7 +1314,7 @@ hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect hibernate.show_sql enabled. -
+
Implementing a <literal>NamingStrategy</literal> The interface org.hibernate.cfg.NamingStrategy @@ -1403,7 +1385,7 @@ hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect them on each entity or collection mapping.
-
+
XML configuration file An alternative approach to configuration is to specify a full @@ -1467,7 +1449,7 @@ hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect .buildSessionFactory();
-
+
Java EE Application Server integration Hibernate has the following integration points for J2EE @@ -1524,7 +1506,7 @@ hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect hibernate.connection.aggressive_release to true if your application server shows "connection containment" exceptions. -
+
Transaction strategy configuration The Hibernate Session API is independent of any @@ -1584,7 +1566,7 @@ hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect you have to specify how Hibernate should obtain a reference to the TransactionManager: -
+
JTA TransactionManagers @@ -1673,7 +1655,7 @@ hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect
-
+
JNDI-bound <literal>SessionFactory</literal> A JNDI-bound Hibernate SessionFactory can @@ -1718,7 +1700,7 @@ hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect chapter 1.
-
+
Current Session context management with JTA The easiest way to handle Sessions and @@ -1743,7 +1725,7 @@ hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect transaction demarcation with CMT is preferred.
-
+
JMX deployment The line cfg.buildSessionFactory() still has to diff --git a/documentation/src/main/docbook/manual/en-US/content/events.xml b/documentation/src/main/docbook/manual/en-US/content/events.xml index 319b3bea00..a57ac38013 100755 --- a/documentation/src/main/docbook/manual/en-US/content/events.xml +++ b/documentation/src/main/docbook/manual/en-US/content/events.xml @@ -1,35 +1,7 @@ - + - -%BOOK_ENTITIES; - -]> - - + Interceptors and events @@ -38,7 +10,7 @@ functionality and the extension of Hibernate functionality. -
+
Interceptors @@ -165,7 +137,7 @@ public class AuditInterceptor extends EmptyInterceptor {
-
+
Event system @@ -219,7 +191,7 @@ public class AuditInterceptor extends EmptyInterceptor {
-
+
Hibernate declarative security Usually, declarative security in Hibernate applications is managed in a session facade diff --git a/documentation/src/main/docbook/manual/en-US/content/example_mappings.xml b/documentation/src/main/docbook/manual/en-US/content/example_mappings.xml index 602584061b..debda408bd 100644 --- a/documentation/src/main/docbook/manual/en-US/content/example_mappings.xml +++ b/documentation/src/main/docbook/manual/en-US/content/example_mappings.xml @@ -1,35 +1,7 @@ - + - -%BOOK_ENTITIES; - -]> - - + Example: Various Mappings @@ -37,7 +9,7 @@ This chapters explores some more complex association mappings. -
+
Employer/Employee @@ -150,7 +122,7 @@ create sequence employer_id_seq]]>
-
+
Author/Work @@ -272,7 +244,7 @@ alter table author_work
-
+
Customer/Order/Product @@ -380,7 +352,7 @@ alter table line_items
-
+
Miscellaneous example mappings @@ -391,7 +363,7 @@ alter table line_items -
+
"Typed" one-to-one association @@ -421,7 +393,7 @@ alter table line_items ]]>
-
+
Composite key example @@ -538,7 +510,7 @@ alter table line_items ]]>
-
+
Many-to-many with shared composite key attribute @@ -577,7 +549,7 @@ alter table line_items ]]>
-
+
Content based discrimination @@ -631,7 +603,7 @@ alter table line_items ]]>
-
+
Associations on alternate keys diff --git a/documentation/src/main/docbook/manual/en-US/content/example_parentchild.xml b/documentation/src/main/docbook/manual/en-US/content/example_parentchild.xml index a7f5a2c101..37ac423b95 100644 --- a/documentation/src/main/docbook/manual/en-US/content/example_parentchild.xml +++ b/documentation/src/main/docbook/manual/en-US/content/example_parentchild.xml @@ -1,35 +1,7 @@ - + - -%BOOK_ENTITIES; - -]> - - + Example: Parent/Child @@ -45,7 +17,7 @@ -
+
A note about collections @@ -88,7 +60,7 @@
-
+
Bidirectional one-to-many @@ -201,7 +173,7 @@ session.flush();]]>
-
+
Cascading life cycle @@ -274,7 +246,7 @@ session.flush();]]>
-
+
Cascades and <literal>unsaved-value</literal> @@ -312,7 +284,7 @@ session.flush();]]>
-
+
Conclusion diff --git a/documentation/src/main/docbook/manual/en-US/content/example_weblog.xml b/documentation/src/main/docbook/manual/en-US/content/example_weblog.xml index e44d76cd3e..86b7315256 100644 --- a/documentation/src/main/docbook/manual/en-US/content/example_weblog.xml +++ b/documentation/src/main/docbook/manual/en-US/content/example_weblog.xml @@ -1,38 +1,10 @@ - + - -%BOOK_ENTITIES; - -]> - - + Example: Weblog Application -
+
Persistent Classes @@ -116,7 +88,7 @@ public class BlogItem {
-
+
Hibernate Mappings @@ -209,7 +181,7 @@ public class BlogItem {
-
+
Hibernate Code diff --git a/documentation/src/main/docbook/manual/en-US/content/filters.xml b/documentation/src/main/docbook/manual/en-US/content/filters.xml index 0298fbc151..68ec947532 100755 --- a/documentation/src/main/docbook/manual/en-US/content/filters.xml +++ b/documentation/src/main/docbook/manual/en-US/content/filters.xml @@ -1,33 +1,7 @@ - - -%BOOK_ENTITIES; -]> - + + + Filtering data Hibernate3 provides an innovative new approach to handling data with @@ -35,7 +9,7 @@ named, parameterized filter that can be enabled or disabled for a particular Hibernate session. -
+
Hibernate filters Hibernate3 has the ability to pre-define filter criteria and attach diff --git a/documentation/src/main/docbook/manual/en-US/content/inheritance_mapping.xml b/documentation/src/main/docbook/manual/en-US/content/inheritance_mapping.xml index 3f291cb849..f1f3362018 100644 --- a/documentation/src/main/docbook/manual/en-US/content/inheritance_mapping.xml +++ b/documentation/src/main/docbook/manual/en-US/content/inheritance_mapping.xml @@ -1,38 +1,10 @@ - + - -%BOOK_ENTITIES; - -]> - - + Inheritance mapping -
+
The three strategies @@ -103,7 +75,7 @@ ]]> -
+
Table per class hierarchy @@ -140,7 +112,7 @@
-
+
Table per subclass @@ -176,7 +148,7 @@
-
+
Table per subclass: using a discriminator @@ -227,7 +199,7 @@
-
+
Mixing table per class hierarchy with table per subclass @@ -266,7 +238,7 @@
-
+
Table per concrete class @@ -315,7 +287,7 @@
-
+
Table per concrete class using implicit polymorphism @@ -353,7 +325,7 @@ using XML entities (for example, [ <!ENTITY allproperties SYSTEM "allproperties.xml"> ] in the DOCTYPE declaration and - &allproperties; in the mapping). + in the mapping). @@ -376,7 +348,7 @@
-
+
Mixing implicit polymorphism with other inheritance mappings @@ -429,7 +401,7 @@
-
+
Limitations diff --git a/documentation/src/main/docbook/manual/en-US/content/performance.xml b/documentation/src/main/docbook/manual/en-US/content/performance.xml index d4747c22ec..af83475b08 100644 --- a/documentation/src/main/docbook/manual/en-US/content/performance.xml +++ b/documentation/src/main/docbook/manual/en-US/content/performance.xml @@ -1,36 +1,10 @@ - - -%BOOK_ENTITIES; -]> - + + + Improving performance -
+
Fetching strategies Hibernate uses a fetching strategy to retrieve @@ -128,7 +102,7 @@ for what data is always available in any detached instance of a particular class. -
+
Working with lazy associations By default, Hibernate3 uses lazy select fetching for collections @@ -176,7 +150,7 @@ Integer accessLevel = (Integer) permissions.get("accounts"); // Error!
-
+
Tuning fetch strategies Select fetching (the default) is extremely vulnerable to N+1 @@ -243,7 +217,7 @@ Integer accessLevel = (Integer) permissions.get("accounts"); // Error!
-
+
Single-ended association proxies Lazy fetching for collections is implemented using Hibernate's own @@ -371,7 +345,7 @@ Cat fritz = (Cat) iter.next(); initialization.
-
+
Initializing collections and proxies A LazyInitializationException will be thrown by @@ -460,7 +434,7 @@ Cat fritz = (Cat) iter.next(); s.createFilter( lazyCollection, "").setFirstResult(0).setMaxResults(10).list();
-
+
Using batch fetching Using batch fetching, Hibernate can load several uninitialized @@ -512,7 +486,7 @@ Cat fritz = (Cat) iter.next(); path might be a better option for read-mostly trees.
-
+
Using subselect fetching If one lazy collection or single-valued proxy has to be fetched, @@ -523,7 +497,7 @@ Cat fritz = (Cat) iter.next();
-
+
Fetch profiles Another way to affect the fetching strategy for loading associated @@ -640,13 +614,14 @@ Customer customer = (Customer) session.get( Customer.class, customerId ); @FetchProfiles can be used. - Currently only join style fetch profiles are supported, but they - plan is to support additional styles. See HHH-3414 - for details. + + Currently only join style fetch profiles are supported, but they plan is to support additional styles. See + HHH-3414 + for details. +
-
+
Using lazy property fetching Hibernate3 supports the lazy fetching of individual properties. @@ -679,7 +654,7 @@ Customer customer = (Customer) session.get( Customer.class, customerId ); <taskdef name="instrument" classname="org.hibernate.tool.instrument.InstrumentTask"> <classpath path="${jar.path}"/> <classpath path="${classes.dir}"/> - <classpath refid="lib.class.path"/> + <classpath refxml:id="lib.class.path"/> </taskdef> <instrument verbose="true"> @@ -699,7 +674,7 @@ Customer customer = (Customer) session.get( Customer.class, customerId );
-
+
The Second Level Cache A Hibernate Session is a transaction-level cache @@ -720,7 +695,7 @@ Customer customer = (Customer) session.get( Customer.class, customerId ); versions prior to Hibernate 3.2 use EhCache as the default cache provider. - +
Cache Providers @@ -835,7 +810,7 @@ Customer customer = (Customer) session.get( Customer.class, customerId );
-
+
Cache mappings As we have done in previous chapters we are looking at the two @@ -903,7 +878,7 @@ Customer customer = (Customer) session.get( Customer.class, customerId ); that. - + Definition of cache concurrency strategy via <classname>@Cache</classname> @@ -934,17 +909,17 @@ public SortedSet<Ticket> getTickets() { its attributes. It allows you to define the caching strategy and region of a given second level cache. - + <classname>@Cache</classname> annotation with attributes - + - + - + @Cache( @@ -980,17 +955,17 @@ public SortedSet<Ticket> getTickets() { linkend="example-hibernate-cache-mapping-element" /> the parallels to anotations is obvious. - + The Hibernate <literal><cache></literal> mapping element - + - + - + <cache @@ -1034,7 +1009,7 @@ public SortedSet<Ticket> getTickets() { strategies
-
+
Strategy: read only If your application needs to read, but not modify, instances of a @@ -1043,7 +1018,7 @@ public SortedSet<Ticket> getTickets() { in a cluster.
-
+
Strategy: read/write If the application needs to update data, a @@ -1061,7 +1036,7 @@ public SortedSet<Ticket> getTickets() { do not support locking.
-
+
Strategy: nonstrict read/write If the application only occasionally needs to update data (i.e. if @@ -1075,7 +1050,7 @@ public SortedSet<Ticket> getTickets() { Session.disconnect() is called.
-
+
Strategy: transactional The transactional cache strategy provides @@ -1084,7 +1059,7 @@ public SortedSet<Ticket> getTickets() { hibernate.transaction.manager_lookup_class.
-
+
Cache-provider/concurrency-strategy compatibility @@ -1212,7 +1187,7 @@ public SortedSet<Ticket> getTickets() {
-
+
Managing the caches Whenever you pass an object to save(), @@ -1316,13 +1291,13 @@ hibernate.cache.use_structured_entries true
-
+
The Query Cache Query result sets can also be cached. This is only useful for queries that are run frequently with the same parameters. -
+
Enabling query caching Caching of query results introduces some overhead in terms of your @@ -1377,7 +1352,7 @@ hibernate.cache.use_structured_entries true
-
+
Query cache regions If you require fine-grained control over query cache expiration @@ -1403,14 +1378,14 @@ hibernate.cache.use_structured_entries true
-
+
Understanding Collection performance In the previous sections we have covered collections and their applications. In this section we explore some more issues in relation to collections at runtime. -
+
Taxonomy Hibernate defines three basic kinds of collections: @@ -1484,7 +1459,7 @@ hibernate.cache.use_structured_entries true individual rows of the collection.
-
+
Lists, maps, idbags and sets are the most efficient collections to update @@ -1513,7 +1488,7 @@ hibernate.cache.use_structured_entries true of collection update performance simply do not apply.
-
+
Bags and lists are the most efficient inverse collections There is a particular case, however, in which bags, and also @@ -1534,7 +1509,7 @@ p.getChildren().add(c); //no need to fetch the collection! sess.flush();
-
+
One shot delete Deleting collection elements one by one can sometimes be extremely @@ -1580,7 +1555,7 @@ sess.flush();
-
+
Monitoring performance Optimization is not much use without monitoring and access to @@ -1588,7 +1563,7 @@ sess.flush(); internal operations. Statistics in Hibernate are available per SessionFactory. -
+
Monitoring a SessionFactory You can access SessionFactory metrics in two @@ -1644,7 +1619,7 @@ server.registerMBean(stats, on); // Register the MBean on the serverlogSummary() method.
-
+
Metrics Hibernate provides a number of metrics, from basic information to diff --git a/documentation/src/main/docbook/manual/en-US/content/persistent_classes.xml b/documentation/src/main/docbook/manual/en-US/content/persistent_classes.xml index e72286b8a0..d8fbd15f47 100644 --- a/documentation/src/main/docbook/manual/en-US/content/persistent_classes.xml +++ b/documentation/src/main/docbook/manual/en-US/content/persistent_classes.xml @@ -1,34 +1,7 @@ - - -%BOOK_ENTITIES; -]> + - + Persistent Classes @@ -45,10 +18,10 @@ java.util.Map instances, for example). -
+
A simple POJO example - + Simple POJO representing a cat package eg; import java.util.Set; @@ -67,7 +40,7 @@ private float weight; private Set kittens = new HashSet(); private void setId(Long id) { - this.id=id; + this.xml:id=id; } public Long getId() { return id; @@ -135,19 +108,19 @@ private float weight; The four main rules of persistent classes are explored in more detail in the following sections. -
+
Implement a no-argument constructor Cat has a no-argument constructor. All persistent classes must have a default constructor (which can be non-public) so that Hibernate can instantiate them using - java.lang.reflect.Constructor.newInstance(). It is recommended + java.lang.reflect.Constructor.newInstance(). It is recommended that this constructor be defined with at least package visibility in order for runtime proxy generation to work properly.
-
+
Provide an identifier property @@ -180,7 +153,7 @@ private float weight;
-
+
Prefer non-final classes (semi-optional) @@ -194,12 +167,12 @@ private float weight; . - + Disabling proxies in <literal>hbm.xml</literal> ...]]> - + Disabling proxies in annotations @@ -212,12 +185,12 @@ private float weight; - + Proxying an interface in <literal>hbm.xml</literal> ...]]> - + Proxying an interface in annotations @@ -231,7 +204,7 @@ private float weight;
-
+
Declare accessors and mutators for persistent fields (optional) @@ -251,7 +224,7 @@ private float weight;
-
+
Implementing inheritance A subclass must also observe the first and second rules. It inherits @@ -272,7 +245,7 @@ public class DomesticCat extends Cat { }
-
+
Implementing <literal>equals()</literal> and <literal>hashCode()</literal> @@ -350,7 +323,7 @@ public class DomesticCat extends Cat { key.
-
+
Dynamic models @@ -478,7 +451,7 @@ dynamicSession.close()
-
+
Tuplizers @@ -521,7 +494,7 @@ dynamicSession.close() shows how to do the same in hbm.xml - + Specify custom tuplizers in annotations @Entity @Tuplizer(impl = DynamicEntityTuplizer.class) @@ -539,7 +512,7 @@ public interface Cuisine { public void setCountry(Country country); } - + Specify custom tuplizers in <literal>hbm.xml</literal> <hibernate-mapping> <class entity-name="Customer"> @@ -561,7 +534,7 @@ public interface Cuisine {
-
+
EntityNameResolvers diff --git a/documentation/src/main/docbook/manual/en-US/content/portability.xml b/documentation/src/main/docbook/manual/en-US/content/portability.xml index a2358ab49a..7f2369f83b 100644 --- a/documentation/src/main/docbook/manual/en-US/content/portability.xml +++ b/documentation/src/main/docbook/manual/en-US/content/portability.xml @@ -1,36 +1,10 @@ - + - -%BOOK_ENTITIES; - -]> - - + Database Portability Considerations -
+
Portability Basics @@ -43,7 +17,7 @@
-
+
Dialect @@ -56,7 +30,7 @@
-
+
Dialect resolution @@ -102,7 +76,7 @@
-
+
Identifier generation @@ -132,7 +106,8 @@ Starting with version 3.2.3, Hibernate comes with a set of - enhanced identifier generators targetting + enhanced + identifier generators targetting portability in a much different way. @@ -158,7 +133,7 @@
-
+
Database functions @@ -191,7 +166,7 @@
-
+
Type mappings @@ -200,11 +175,11 @@ diff --git a/documentation/src/main/docbook/manual/en-US/content/preface.xml b/documentation/src/main/docbook/manual/en-US/content/preface.xml index 51cdc59dfd..70d41973b1 100644 --- a/documentation/src/main/docbook/manual/en-US/content/preface.xml +++ b/documentation/src/main/docbook/manual/en-US/content/preface.xml @@ -1,35 +1,7 @@ - + - -%BOOK_ENTITIES; - -]> - - + Preface @@ -37,7 +9,8 @@ Development costs are significantly higher due to a paradigm mismatch between how data is represented in objects versus relational databases. Hibernate is an Object/Relational Mapping solution for Java environments. The term Object/Relational Mapping refers to the technique of mapping data from an object model representation - to a relational data model representation (and visa versa). See + to a relational data model representation (and visa versa). See + for a good high-level discussion. @@ -50,12 +23,12 @@ - http://www.agiledata.org/essays/dataModeling101.html + - http://en.wikipedia.org/wiki/Data_modeling + @@ -117,8 +90,8 @@ information. Consider reading if you need more help with application design, or if you prefer a step-by-step tutorial. Also visit - and download - the example application from . + + and download the example application from . @@ -147,21 +120,21 @@ Trying stuff out and reporting bugs. See - http://hibernate.org/issuetracker.html + details. Trying your hand at fixing some bugs or implementing enhancements. Again, see - http://hibernate.org/issuetracker.html + details. - http://hibernate.org/community.html list - a few ways to engage in the community. + + lists a few ways to engage in the community. @@ -170,7 +143,8 @@ - There are also IRC + There are also + IRC channels for both user and developer discussions. diff --git a/documentation/src/main/docbook/manual/en-US/content/query_criteria.xml b/documentation/src/main/docbook/manual/en-US/content/query_criteria.xml index ed10448a05..6fa014e543 100644 --- a/documentation/src/main/docbook/manual/en-US/content/query_criteria.xml +++ b/documentation/src/main/docbook/manual/en-US/content/query_criteria.xml @@ -1,42 +1,14 @@ - + - -%BOOK_ENTITIES; - -]> - - + Criteria Queries Hibernate features an intuitive, extensible criteria query API. -
+
Creating a <literal>Criteria</literal> instance @@ -51,7 +23,7 @@ List cats = crit.list();]]>
-
+
Narrowing the result set @@ -123,7 +95,7 @@ List cats = sess.createCriteria(Cat.class)
-
+
Ordering the results @@ -146,7 +118,7 @@ List cats = sess.createCriteria(Cat.class)
-
+
Associations @@ -230,7 +202,7 @@ while ( iter.hasNext() ) {
-
+
Dynamic association fetching @@ -251,7 +223,7 @@ while ( iter.hasNext() ) {
-
+
Components @@ -275,7 +247,7 @@ while ( iter.hasNext() ) {
-
+
Collections When using criteria against collections, there are two distinct cases. One is if @@ -303,7 +275,7 @@ while ( iter.hasNext() ) {
-
+
Example queries @@ -348,7 +320,7 @@ List results = session.createCriteria(Cat.class)
-
+
Projections, aggregation and grouping The class org.hibernate.criterion.Projections is a @@ -442,7 +414,7 @@ List results = session.createCriteria(Cat.class)
-
+
Detached queries and subqueries The DetachedCriteria class allows you to create a query outside the scope @@ -505,7 +477,7 @@ session.createCriteria( Woman.class ) user objects - similar to setResultClass in JDO2. General use of ResultTransformer could also be explained. --> -
+
Queries by natural identifier diff --git a/documentation/src/main/docbook/manual/en-US/content/query_hql.xml b/documentation/src/main/docbook/manual/en-US/content/query_hql.xml index af85f4d390..e69d2b8f53 100644 --- a/documentation/src/main/docbook/manual/en-US/content/query_hql.xml +++ b/documentation/src/main/docbook/manual/en-US/content/query_hql.xml @@ -1,35 +1,7 @@ - + - -%BOOK_ENTITIES; - -]> - - + HQL: The Hibernate Query Language @@ -38,7 +10,7 @@ and understands notions like inheritance, polymorphism and association. -
+
Case Sensitivity @@ -59,7 +31,7 @@
-
+
The from clause @@ -107,7 +79,7 @@
-
+
Associations and joins @@ -219,7 +191,7 @@
-
+
Forms of join syntax @@ -241,7 +213,7 @@
-
+
Referring to identifier property @@ -280,7 +252,7 @@
-
+
The select clause @@ -357,7 +329,7 @@ from Cat cat]]>
-
+
Aggregate functions @@ -422,7 +394,7 @@ select count(distinct cat.name), count(cat) from Cat cat]]>
-
+
Polymorphic queries @@ -456,7 +428,7 @@ select count(distinct cat.name), count(cat) from Cat cat]]>
-
+
The where clause @@ -583,7 +555,7 @@ where log.item.class = 'Payment' and log.item.id = payment.id]]> -
+
Expressions @@ -876,7 +848,7 @@ WHERE prod.name = 'widget'
-
+
The order by clause @@ -892,7 +864,7 @@ order by cat.name asc, cat.weight desc, cat.birthdate]]>
-
+
The group by clause @@ -940,7 +912,7 @@ order by count(kitten) asc, sum(kitten.weight) desc]]>
-
+
Subqueries @@ -983,7 +955,7 @@ from Cat as cat]]>
-
+
HQL examples @@ -1106,7 +1078,7 @@ order by account.type.sortOrder, account.accountNumber, payment.dueDate]]> -
+
Bulk update and delete @@ -1116,7 +1088,7 @@ order by account.type.sortOrder, account.accountNumber, payment.dueDate]]>
-
+
Tips & Tricks @@ -1196,7 +1168,7 @@ Collection counts = s.filter( collection, "select this.type, count(this) group b
-
+
Components @@ -1227,7 +1199,7 @@ Collection counts = s.filter( collection, "select this.type, count(this) group b
-
+
Row value constructor syntax diff --git a/documentation/src/main/docbook/manual/en-US/content/query_sql.xml b/documentation/src/main/docbook/manual/en-US/content/query_sql.xml index 7b6dcf70d4..dce2f947a3 100644 --- a/documentation/src/main/docbook/manual/en-US/content/query_sql.xml +++ b/documentation/src/main/docbook/manual/en-US/content/query_sql.xml @@ -1,33 +1,7 @@ - - -%BOOK_ENTITIES; -]> - + + + Native SQL You can also express queries in the native SQL dialect of your @@ -39,7 +13,7 @@ Hibernate3 allows you to specify handwritten SQL, including stored procedures, for all create, update, delete, and load operations. -
+
Using a <literal>SQLQuery</literal> Execution of native SQL queries is controlled via the @@ -250,7 +224,7 @@ List loggedCats = sess.createSQLQuery(sql) .addEntity("mother", Cat.class).list() -
+
Alias and property references In most cases the above alias injection is needed. For queries @@ -263,7 +237,7 @@ List loggedCats = sess.createSQLQuery(sql) simply examples; each alias will have a unique and probably different name when used. - +
Alias injection names @@ -418,7 +392,7 @@ List pusList = query.setString("name", "Pus%").list(); -
+
Named SQL queries Named SQL queries can also be defined in the mapping document and @@ -574,7 +548,7 @@ List pusList = query.setString("name", "Pus%").list(); . - + Named SQL query using <classname>@NamedNativeQuery</classname> together with <classname>@SqlResultSetMapping</classname> @@ -598,7 +572,7 @@ List pusList = query.setString("name", "Pus%").list(); - + Implicit result set mapping @Entity @@ -640,7 +614,7 @@ public class SpaceShip { } - + Using dot notation in @FieldResult for specifying associations @@ -771,7 +745,7 @@ public class SpaceShip { org.hibernate.callable which can be true or false depending on whether the query is a stored procedure or not. -
+
Using return-property to explicitly specify column/alias names @@ -824,7 +798,7 @@ public class SpaceShip { discriminator column.
-
+
Using stored procedures for querying Hibernate3 provides support for queries via stored procedures and @@ -869,7 +843,7 @@ BEGIN <return-join> and <load-collection> are not supported. -
+
Rules/limitations for using stored procedures You cannot use stored procedures with Hibernate unless you @@ -922,7 +896,7 @@ BEGIN
-
+
Custom SQL for create, update and delete Hibernate3 can use custom SQL for create, update, and delete @@ -932,7 +906,7 @@ BEGIN linkend="example-custom-crdu-via-annotations" /> shows how to define custom SQL operatons using annotations. - + Custom CRUD via annotations @Entity @@ -942,7 +916,7 @@ BEGIN @SQLDelete( sql="DELETE CHAOS WHERE id = ?") @SQLDeleteAll( sql="DELETE CHAOS") @Loader(namedQuery = "chaos") -@NamedNativeQuery(name="chaos", query="select id, size, name, lower( nickname ) as nickname from CHAOS where id= ?", resultClass = Chaos.class) +@NamedNativeQuery(name="chaos", query="select id, size, name, lower( nickname ) as nickname from CHAOS where xml:id= ?", resultClass = Chaos.class) public class Chaos { @Id private Long id; @@ -960,7 +934,7 @@ public class Chaos { <sql-delete> nodes. This can be seen in . - + Custom CRUD XML <class name="Person"> @@ -969,8 +943,8 @@ public class Chaos { </id> <property name="name" not-null="true"/> <sql-insert>INSERT INTO PERSON (NAME, ID) VALUES ( UPPER(?), ? )</sql-insert> - <sql-update>UPDATE PERSON SET NAME=UPPER(?) WHERE ID=?</sql-update> - <sql-delete>DELETE FROM PERSON WHERE ID=?</sql-delete> + <sql-update>UPDATE PERSON SET NAME=UPPER(?) WHERE xml:id=?</sql-update> + <sql-delete>DELETE FROM PERSON WHERE xml:id=?</sql-delete> </class> @@ -1005,7 +979,7 @@ public class Chaos { to override the collection related statements -see . - + Overriding SQL statements for collections using annotations @@ -1081,7 +1055,7 @@ END updatePerson;
-
+
Custom SQL for loading You can also declare your own SQL (or HQL) queries for entity @@ -1094,7 +1068,7 @@ END updatePerson; <return alias="pers" class="Person" lock-mode="upgrade"/> SELECT NAME AS {pers.name}, ID AS {pers.id} FROM PERSON - WHERE ID=? + WHERE xml:id=? FOR UPDATE </sql-query> @@ -1137,7 +1111,7 @@ END updatePerson; FROM PERSON pers LEFT OUTER JOIN EMPLOYMENT emp ON pers.ID = emp.PERSON_ID - WHERE ID=? + WHERE xml:id=? </sql-query> The annotation equivalent <loader> is the diff --git a/documentation/src/main/docbook/manual/en-US/content/readonly.xml b/documentation/src/main/docbook/manual/en-US/content/readonly.xml index b2616de030..704c00b69e 100644 --- a/documentation/src/main/docbook/manual/en-US/content/readonly.xml +++ b/documentation/src/main/docbook/manual/en-US/content/readonly.xml @@ -1,35 +1,7 @@ - + - -%BOOK_ENTITIES; - -]> - - + Read-only entities @@ -124,7 +96,7 @@ -
+
Making persistent entities read-only @@ -170,7 +142,7 @@ -
+
Entities of immutable classes @@ -192,7 +164,7 @@
-
+
Loading persistent entities as read-only @@ -279,7 +251,7 @@
-
+
Loading read-only entities from an HQL query/criteria @@ -380,7 +352,7 @@ session.close();
-
+
Making a persistent entity read-only @@ -434,7 +406,7 @@ s.flush();
-
+
Read-only affect on property type @@ -442,7 +414,7 @@ s.flush(); affected by making an entity read-only. -
+
Affect of read-only entity on property types @@ -532,7 +504,7 @@ s.flush(); is read-only, compared to when it is not read-only. -
+
Simple properties @@ -569,10 +541,10 @@ session.close();
-
+
Unidirectional associations -
+
Unidirectional one-to-one and many-to-one @@ -678,7 +650,7 @@ session.close();
-
+
Unidirectional one-to-many and many-to-many @@ -714,10 +686,10 @@ session.close();
-
+
Bidirectional associations -
+
Bidirectional one-to-one @@ -767,7 +739,7 @@ session.close();
-
+
Bidirectional one-to-many/many-to-one @@ -818,7 +790,7 @@ session.close();
-
+
Bidirectional many-to-many Hibernate treats bidirectional many-to-many diff --git a/documentation/src/main/docbook/manual/en-US/content/session_api.xml b/documentation/src/main/docbook/manual/en-US/content/session_api.xml index 30b19c997b..e4bd954924 100644 --- a/documentation/src/main/docbook/manual/en-US/content/session_api.xml +++ b/documentation/src/main/docbook/manual/en-US/content/session_api.xml @@ -1,33 +1,7 @@ - - -%BOOK_ENTITIES; -]> - + + + Working with objects Hibernate is a full object/relational mapping solution that not only @@ -43,7 +17,7 @@ Hibernate and is only relevant for the application developer when tuning the performance of the system. -
+
Hibernate object states Hibernate defines and supports the following object states: @@ -91,7 +65,7 @@ Hibernate methods that trigger a transition) in more detail.
-
+
Making objects persistent Newly instantiated instances of a persistent class are considered @@ -163,7 +137,7 @@ sess.save( pk, new Long(1234) ); chapter.
-
+
Loading an object The load() methods of Session @@ -231,7 +205,7 @@ sess.refresh(cat); //re-read the state (after the trigger executes).
-
+
Querying If you do not know the identifiers of the objects you are looking @@ -242,7 +216,7 @@ sess.refresh(cat); //re-read the state (after the trigger executes) -
+
Executing queries HQL and native SQL queries are represented with an instance of @@ -284,7 +258,7 @@ Set uniqueMothers = new HashSet(mothersWithKittens.list()); objects, but with their collections initialized. You can filter these duplicates through a Set. -
+
Iterating results Occasionally, you might be able to achieve better performance by @@ -312,7 +286,7 @@ while ( iter.hasNext() ) { }
-
+
Queries that return tuples Hibernate queries sometimes return tuples of objects. Each tuple @@ -331,7 +305,7 @@ while ( kittensAndMothers.hasNext() ) { }
-
+
Scalar results Queries can specify a property of a class in the @@ -354,7 +328,7 @@ while ( results.hasNext() ) { }
-
+
Bind parameters Methods on Query are provided for binding @@ -398,7 +372,7 @@ q.setParameterList("namesList", names); List cats = q.list();
-
+
Pagination If you need to specify bounds upon your result set, that is, the @@ -415,7 +389,7 @@ List cats = q.list(); native SQL of your DBMS.
-
+
Scrollable iteration If your JDBC driver supports scrollable @@ -451,7 +425,7 @@ cats.close() if you need offline pagination functionality.
-
+
Externalizing named queries Queries can also be configured as so called named queries using @@ -463,7 +437,7 @@ cats.close() scope. A named query is defined by its name and the actual query string. - + Defining a named query using <classname>@NamedQuery</classname> @@ -503,7 +477,7 @@ public class MyDao { Parameter binding and executing is done programatically as seen in . - + Parameter binding of a named query Query q = sess.getNamedQuery("ByNameAndMaximumWeight"); @@ -526,7 +500,7 @@ List cats = q.list();
-
+
Filtering collections A collection filter is a special type of @@ -564,7 +538,7 @@ List cats = q.list(); .list();
-
+
Criteria queries HQL is extremely powerful, but some developers prefer to build @@ -582,7 +556,7 @@ List cats = crit.list(); linkend="querycriteria" />.
-
+
Queries in native SQL You can express a query in SQL, using @@ -609,7 +583,7 @@ List cats = crit.list();
-
+
Modifying persistent objects Transactional persistent instances (i.e. @@ -635,7 +609,7 @@ sess.flush(); // changes to cat are automatically detected and persisted -
+
Modifying detached objects Many applications need to retrieve an object in one transaction, @@ -699,7 +673,7 @@ sess.lock(pk, LockMode.UPGRADE); linkend="transactions-optimistic" />.
-
+
Automatic state detection Hibernate users have requested a general purpose method that either @@ -815,7 +789,7 @@ secondSession.saveOrUpdate(mate); // save the new instance (mate has a null id)
-
+
Deleting persistent objects Session.delete() will remove an object's state @@ -832,7 +806,7 @@ secondSession.saveOrUpdate(mate); // save the new instance (mate has a null id) children.
-
+
Replicating object between two different datastores It is sometimes useful to be able to take a graph of persistent @@ -887,7 +861,7 @@ session2.close(); transactions and more.
-
+
Flushing the Session Sometimes the Session will execute the SQL @@ -982,7 +956,7 @@ sess.close(); .
-
+
Transitive persistence It is quite cumbersome to save, delete, or reattach individual @@ -1084,7 +1058,7 @@ sess.close(); association, this associated entity can be marked for deletion if orphanRemoval is set to true. - + <literal>@OneToMany</literal> with <literal>orphanRemoval</literal> @@ -1123,8 +1097,9 @@ customer.getOrders().remove(order); //order will be deleted by cascadeIf the child object's lifespan is bounded by the lifespan of the parent object, make it a life cycle object by specifying - cascade="all,delete-orphan"(@OneToMany(cascade=CascadeType.ALL, - orphanRemoval=true)). + cascade="all,delete-orphan" (@OneToMany(cascade=CascadeType.ALL, + orphanRemoval=true)). + @@ -1197,7 +1172,7 @@ customer.getOrders().remove(order); //order will be deleted by cascadeSession.
-
+
Using metadata Hibernate requires a rich meta-level model of all entity and value diff --git a/documentation/src/main/docbook/manual/en-US/content/toolset_guide.xml b/documentation/src/main/docbook/manual/en-US/content/toolset_guide.xml index b8d28b2469..b01f453117 100644 --- a/documentation/src/main/docbook/manual/en-US/content/toolset_guide.xml +++ b/documentation/src/main/docbook/manual/en-US/content/toolset_guide.xml @@ -1,35 +1,7 @@ - + - -%BOOK_ENTITIES; - -]> - - + Toolset Guide @@ -79,7 +51,7 @@ be used from "inside" Hibernate. -
+
Automatic schema generation @@ -99,7 +71,7 @@ First, you must customize your mapping files to improve the generated schema. The next section covers schema customization. -
+
Customizing the schema @@ -199,7 +171,7 @@ The following table summarizes these optional attributes. -
+
Summary @@ -310,7 +282,7 @@ -
+
Running the tool @@ -390,7 +362,7 @@ new SchemaExport(cfg).create(false, true);]]>
-
+
Properties @@ -451,7 +423,7 @@ new SchemaExport(cfg).create(false, true);]]>
-
+
Using Ant @@ -478,7 +450,7 @@ new SchemaExport(cfg).create(false, true);]]>
-
+
Incremental schema updates @@ -537,7 +509,7 @@ new SchemaUpdate(cfg).execute(false);]]>
-
+
Using Ant for incremental schema updates @@ -560,7 +532,7 @@ new SchemaUpdate(cfg).execute(false);]]>
-
+
Schema validation @@ -612,7 +584,7 @@ new SchemaValidator(cfg).validate();]]>
-
+
Using Ant for schema validation diff --git a/documentation/src/main/docbook/manual/en-US/content/transactions.xml b/documentation/src/main/docbook/manual/en-US/content/transactions.xml index e2f11d7479..9e05f8ca11 100644 --- a/documentation/src/main/docbook/manual/en-US/content/transactions.xml +++ b/documentation/src/main/docbook/manual/en-US/content/transactions.xml @@ -1,35 +1,7 @@ - + - -%BOOK_ENTITIES; - -]> - - + Transactions and Concurrency @@ -60,7 +32,7 @@ Session, as well as database transactions and long conversations. -
+
Session and transaction scopes @@ -92,7 +64,7 @@ database transaction boundaries? These questions are addressed in the following sections. -
+
Unit of work @@ -173,7 +145,7 @@
-
+
Long conversations @@ -267,7 +239,7 @@
-
+
Considering object identity @@ -334,7 +306,7 @@
-
+
Common issues @@ -386,7 +358,7 @@
-
+
Database transaction demarcation @@ -451,7 +423,7 @@ -
+
Non-managed environment @@ -526,7 +498,7 @@ catch (RuntimeException e) {
-
+
Using JTA @@ -629,7 +601,7 @@ catch (RuntimeException e) {
-
+
Exception handling @@ -704,7 +676,7 @@ catch (RuntimeException e) {
-
+
Transaction timeout @@ -749,7 +721,7 @@ finally {
-
+
Optimistic concurrency control @@ -762,7 +734,7 @@ finally { also has the benefit of preventing lost updates in single database transactions. -
+
Application version checking @@ -811,7 +783,7 @@ session.close();]]>
-
+
Extended session and automatic versioning @@ -889,7 +861,7 @@ session.close(); // Only for last transaction in conversation]]> -
+
Detached objects and automatic versioning @@ -921,7 +893,7 @@ session.close();]]>
-
+
Customizing automatic versioning @@ -966,7 +938,7 @@ session.close();]]>
-
+
Pessimistic locking @@ -1068,7 +1040,7 @@ session.close();]]>
-
+
Connection release modes diff --git a/documentation/src/main/docbook/manual/en-US/content/tutorial.xml b/documentation/src/main/docbook/manual/en-US/content/tutorial.xml index f5048307da..e1214682e7 100644 --- a/documentation/src/main/docbook/manual/en-US/content/tutorial.xml +++ b/documentation/src/main/docbook/manual/en-US/content/tutorial.xml @@ -1,36 +1,7 @@ - + - -%BOOK_ENTITIES; - -]> - - - + Tutorial @@ -58,7 +29,7 @@ -
+
Part 1 - The first Hibernate Application @@ -69,20 +40,22 @@ Although you can use whatever database you feel comfortable using, we - will use HSQLDB (an in-memory, - Java database) to avoid describing installation/setup of any particular + will use HSQLDB + (an in-memory, Java database) to avoid describing installation/setup of any particular database servers. -
+
Setup The first thing we need to do is to set up the development environment. We will be using the "standard layout" advocated by alot of build tools such - as Maven. Maven, in particular, has a - good resource describing this layout. + as Maven. + Maven, in particular, has a + good resource describing this + layout. As this tutorial is to be a web application, we will be creating and making use of src/main/java, src/main/resources and src/main/webapp directories. @@ -142,7 +115,8 @@ It is not a requirement to use Maven. If you wish to use something else to build this tutorial (such as Ant), the layout will remain the same. The only change is that you will need to manually account for all the needed - dependencies. If you use something like Ivy + dependencies. If you use something like + Ivy providing transitive dependency management you would still use the dependencies mentioned below. Otherwise, you'd need to grab all dependencies, both explicit and transitive, and add them to the project's @@ -161,7 +135,7 @@
-
+
The first class @@ -243,7 +217,7 @@ public class Event {
-
+
The mapping file @@ -419,7 +393,7 @@ public class Event {
-
+
Hibernate configuration @@ -450,9 +424,10 @@ public class Event { how to obtain connections. For this tutorial we will be using a standalone connection pool (as opposed to a javax.sql.DataSource). Hibernate comes with support for two third-party open source JDBC connection pools: - c3p0 and - proxool. However, we will be using the - Hibernate built-in connection pool for this tutorial. + c3p0 + and + proxool. + However, we will be using the Hibernate built-in connection pool for this tutorial. @@ -547,13 +522,13 @@ public class Event {
-
+
Building with Maven We will now build the tutorial with Maven. You will need to have Maven installed; it is available from the - Maven download page. + Maven download page. Maven will read the /pom.xml file we created earlier and know how to perform some basic project tasks. First, lets run the compile goal to make sure we can compile @@ -580,7 +555,7 @@ public class Event {
-
+
Startup and helpers @@ -670,7 +645,7 @@ public class HibernateUtil {
-
+
Loading and storing objects @@ -722,11 +697,11 @@ public class EventManager { - A org.hibernate.Session is designed to + A org.hibernate.Session is designed to represent a single unit of work (a single atomic piece of work to be performed). For now we will keep things simple and assume a one-to-one granularity between a Hibernate - org.hibernate.Session and a database + org.hibernate.Session and a database transaction. To shield our code from the actual underlying transaction system we use the Hibernate org.hibernate.Transaction API. @@ -758,28 +733,28 @@ public class EventManager { - A org.hibernate.Session begins when the + A org.hibernate.Session begins when the first call to getCurrentSession() is made for the current thread. It is then bound by Hibernate to the current thread. When the transaction ends, either through commit or rollback, Hibernate automatically unbinds the - org.hibernate.Session from the thread + org.hibernate.Session from the thread and closes it for you. If you call getCurrentSession() again, you get a new - org.hibernate.Session and can start a + org.hibernate.Session and can start a new unit of work. Related to the unit of work scope, should the Hibernate - org.hibernate.Session be used to execute + org.hibernate.Session be used to execute one or several database operations? The above example uses one - org.hibernate.Session for one operation. + org.hibernate.Session for one operation. However this is pure coincidence; the example is just not complex enough to show any other approach. The scope of a Hibernate - org.hibernate.Session is flexible but you + org.hibernate.Session is flexible but you should never design your application to use a new Hibernate - org.hibernate.Session for + org.hibernate.Session for every database operation. Even though it is used in the following examples, consider session-per-operation an anti-pattern. @@ -862,7 +837,7 @@ public class EventManager {
-
+
Part 2 - Mapping associations @@ -872,7 +847,7 @@ public class EventManager { which they participate. -
+
Mapping the Person class @@ -933,7 +908,7 @@ public class Person {
-
+
A unidirectional Set-based association @@ -1024,7 +999,7 @@ public class Person {
-
+
Working the association @@ -1145,7 +1120,7 @@ public class Person {
-
+
Collection of values @@ -1237,7 +1212,7 @@ public class Person {
-
+
Bi-directional associations @@ -1296,7 +1271,7 @@ public class Person {
-
+
Working bi-directional links @@ -1354,7 +1329,7 @@ public class Person {
-
+
Part 3 - The EventManager web application @@ -1364,7 +1339,7 @@ public class Person { database, and it provides an HTML form to enter new events. -
+
Writing the basic servlet @@ -1446,7 +1421,7 @@ public class EventManagerServlet extends HttpServlet {
-
+
Processing and rendering @@ -1556,7 +1531,7 @@ public class EventManagerServlet extends HttpServlet {
-
+
Deploying and testing @@ -1591,7 +1566,8 @@ public class EventManagerServlet extends HttpServlet { If you do not have Tomcat installed, download it from - and follow the + + and follow the installation instructions. Our application requires no changes to the standard Tomcat configuration. @@ -1609,13 +1585,13 @@ public class EventManagerServlet extends HttpServlet {
-
+
Summary This tutorial covered the basics of writing a simple standalone Hibernate application and a small web application. More tutorials are available from the Hibernate - website. + website.
diff --git a/documentation/src/main/docbook/manual/en-US/content/type.xml b/documentation/src/main/docbook/manual/en-US/content/type.xml index fd05981fbe..9836fd0d1d 100644 --- a/documentation/src/main/docbook/manual/en-US/content/type.xml +++ b/documentation/src/main/docbook/manual/en-US/content/type.xml @@ -1,29 +1,6 @@ - - + - + Types @@ -52,7 +29,7 @@ entity types (see ). -
+
Value types @@ -63,7 +40,7 @@ amd collection types (see ). -
+
Basic value types The norm for basic value types is that they map a single database value (column) to a single, @@ -72,7 +49,7 @@ JDBC specification. We will later cover how to override these mapping and how to provide and use alternative type mappings. -
+
java.lang.String @@ -114,7 +91,7 @@
-
+
<classname>java.lang.Character</classname> (or char primitive) @@ -131,7 +108,7 @@
-
+
<classname>java.lang.Boolean</classname> (or boolean primitive) @@ -184,7 +161,7 @@
-
+
<classname>java.lang.Byte</classname> (or byte primitive) @@ -201,7 +178,7 @@
-
+
<classname>java.lang.Short</classname> (or short primitive) @@ -218,7 +195,7 @@
-
+
<classname>java.lang.Integer</classname> (or int primitive) @@ -235,7 +212,7 @@
-
+
<classname>java.lang.Long</classname> (or long primitive) @@ -252,7 +229,7 @@
-
+
<classname>java.lang.Float</classname> (or float primitive) @@ -269,7 +246,7 @@
-
+
<classname>java.lang.Double</classname> (or double primitive) @@ -286,7 +263,7 @@
-
+
<classname>java.math.BigInteger</classname> @@ -303,7 +280,7 @@
-
+
<classname>java.math.BigDecimal</classname> @@ -320,7 +297,7 @@
-
+
<classname>java.util.Date</classname> or <classname>java.sql.Timestamp</classname> @@ -337,7 +314,7 @@
-
+
<classname>java.sql.Time</classname> @@ -354,7 +331,7 @@
-
+
<classname>java.sql.Date</classname> @@ -371,7 +348,7 @@
-
+
<classname>java.util.Calendar</classname> @@ -401,7 +378,7 @@
-
+
<classname>java.util.Currency</classname> @@ -418,7 +395,7 @@
-
+
<classname>java.util.Locale</classname> @@ -435,7 +412,7 @@
-
+
<classname>java.util.TimeZone</classname> @@ -452,7 +429,7 @@
-
+
<classname>java.net.URL</classname> @@ -469,7 +446,7 @@
-
+
<classname>java.lang.Class</classname> @@ -486,7 +463,7 @@
-
+
<classname>java.sql.Blob</classname> @@ -503,7 +480,7 @@
-
+
<classname>java.sql.Clob</classname> @@ -520,7 +497,7 @@
-
+
byte[] @@ -561,7 +538,7 @@
-
+
Byte[] @@ -578,7 +555,7 @@
-
+
char[] @@ -595,7 +572,7 @@
-
+
Character[] @@ -612,7 +589,7 @@
-
+
<classname>java.util.UUID</classname> @@ -654,7 +631,7 @@
-
+
<interfacename>java.io.Serializable</interfacename> @@ -675,7 +652,7 @@
-
+
Composite types @@ -695,7 +672,7 @@
-
+
Collection types @@ -711,7 +688,7 @@
-
+
Entity types The definition of entities is covered in detail in . For the purpose of @@ -730,7 +707,7 @@
-
+
Significance of type categories Why do we spend so much time categorizing the various types of types? What is the significance of the @@ -753,7 +730,7 @@
-
+
Custom types Hibernate makes it relatively easy for developers to create their own value types. For @@ -769,7 +746,7 @@ and java.util.Currency together into a custom Money class. -
+
Custom types using <interfacename>org.hibernate.type.Type</interfacename> The first approach is to directly implement the org.hibernate.type.Type @@ -781,7 +758,7 @@ Money, which is the key we would use to register our type in the registry: - + Defining and registering the custom Type
-
+
Custom types using <interfacename>org.hibernate.usertype.UserType</interfacename> @@ -859,7 +836,7 @@ cfg...; interface. Using a org.hibernate.usertype.UserType, our Money custom type would look as follows: - + Defining the custom UserType
-
+
Custom types using <interfacename>org.hibernate.usertype.CompositeUserType</interfacename> The third and final approach is the use the org.hibernate.usertype.CompositeUserType @@ -918,7 +895,7 @@ cfg...; Money custom type would look as follows: - + Defining the custom CompositeUserType -
+
Type registry Internally Hibernate uses a registry of basic types (see ) when @@ -1016,7 +993,7 @@ cfg...; class when bootstrapping Hibernate. For example, lets say you want Hibernate to use your custom SuperDuperStringType; during bootstrap you would call: - + Overriding the standard <classname>StringType</classname> diff --git a/documentation/src/main/docbook/manual/en-US/content/xml.xml b/documentation/src/main/docbook/manual/en-US/content/xml.xml index 37facd5b88..5fbb1852e2 100755 --- a/documentation/src/main/docbook/manual/en-US/content/xml.xml +++ b/documentation/src/main/docbook/manual/en-US/content/xml.xml @@ -1,35 +1,7 @@ - + - -%BOOK_ENTITIES; - -]> - - + XML Mapping @@ -37,7 +9,7 @@ active development. -
+
Working with XML data @@ -68,7 +40,7 @@ it can be used to map just the XML. -
+
Specifying XML and class mapping together @@ -97,7 +69,7 @@ ]]>
-
+
Specifying only an XML mapping @@ -138,7 +110,7 @@
-
+
XML mapping metadata @@ -227,7 +199,7 @@ would return datasets such as this: - + 987632567 985612323 @@ -243,13 +215,13 @@ mapping, the data might look more like this: - - - + + + 100.29 - - + + -2370.34 @@ -263,7 +235,7 @@
-
+
Manipulating XML data diff --git a/documentation/src/main/docbook/quickstart/en-US/Author_Group.xml b/documentation/src/main/docbook/quickstart/en-US/Author_Group.xml index a181dab081..77d800c8ec 100644 --- a/documentation/src/main/docbook/quickstart/en-US/Author_Group.xml +++ b/documentation/src/main/docbook/quickstart/en-US/Author_Group.xml @@ -1,43 +1,52 @@ - -%BOOK_ENTITIES; -]> - - + - Gavin - King + + Gavin + King + - Christian - Bauer + + Christian + Bauer + - Emmanuel - Bernard + + Steve + Ebersole + - Steve - Ebersole + + Emmanuel + Bernard + + + + + Adam + Warski + - - Adam - Warski - - James - Cobb + + James + Cobb + Graphic Design - Cheyenne - Weaver + + Cheyenne + Weaver + Graphic Design diff --git a/documentation/src/main/docbook/quickstart/en-US/Book_Info.xml b/documentation/src/main/docbook/quickstart/en-US/Book_Info.xml deleted file mode 100644 index 154ba609db..0000000000 --- a/documentation/src/main/docbook/quickstart/en-US/Book_Info.xml +++ /dev/null @@ -1,29 +0,0 @@ - - -%BOOK_ENTITIES; -]> - - - Hibernate Getting Started Guide - &version; - 1.0 - 1 - JBoss Hibernate Core - &version; - &today; - 1 - - - - - - - - - - ©rightYear; - ©rightHolder; - - - diff --git a/documentation/src/main/docbook/quickstart/en-US/Hibernate_Getting_Started_Guide.xml b/documentation/src/main/docbook/quickstart/en-US/Hibernate_Getting_Started_Guide.xml index aaedbdc3fc..5ec1c53713 100644 --- a/documentation/src/main/docbook/quickstart/en-US/Hibernate_Getting_Started_Guide.xml +++ b/documentation/src/main/docbook/quickstart/en-US/Hibernate_Getting_Started_Guide.xml @@ -1,11 +1,33 @@ - - %BOOK_ENTITIES; + +%BOOK_ENTITIES; ]> - + + Hibernate Getting Started Guide + &version; + 1.0 + JBoss Hibernate Core + &version; + &today; + 1 + + + + + + + + + + ©rightYear; + ©rightHolder; + + + + diff --git a/documentation/src/main/docbook/quickstart/en-US/content/obtaining.xml b/documentation/src/main/docbook/quickstart/en-US/content/obtaining.xml index 9ef871dd52..29add36279 100644 --- a/documentation/src/main/docbook/quickstart/en-US/content/obtaining.xml +++ b/documentation/src/main/docbook/quickstart/en-US/content/obtaining.xml @@ -1,11 +1,9 @@ - - - + Obtaining Hibernate -
+
Release Bundle Downloads The Hibernate team provides release bundles hosted on the SourceForge File Release System, in @@ -17,7 +15,7 @@ You can download releases of Hibernate, in your chosen format, from the list at - . + . @@ -31,7 +29,7 @@ The /lib/jpa/ directory contains the hibernate-entitymanager jar and its dependencies beyond those in lib/required/. This defines Hibernate support for - JPA. + JPA. @@ -49,7 +47,7 @@
-
+
Maven Repository Artifacts @@ -60,18 +58,18 @@ Maven Repository Wiki Pages - - General information about the repository. + - General information about the repository. - - Information about setting up the JBoss + - Information about setting up the JBoss repositories in order to do development work on JBoss projects themselves. - - Information about setting up access to + - Information about setting up access to the repository to use JBoss projects as part of your own software. @@ -99,7 +97,7 @@ Represents Hibernate's implementation of JPA, as specified at - . + . This artifact depends on hibernate-core @@ -123,7 +121,7 @@ Provides integration between Hibernate and the C3P0 connection - pool library. See for information + pool library. See for information about C3P0. @@ -138,7 +136,7 @@ Provides integration between Hibernate and the Proxool connection - pool library. See for more information about + pool library. See for more information about this library. @@ -153,7 +151,7 @@ Privides integration between Hibernate and EhCache, as a - second-level cache. See for more + second-level cache. See for more information aboutEhCache. @@ -168,7 +166,7 @@ Provides integration between Hibernate and Infinispan, as a - second-level cache. See for more information + second-level cache. See for more information about Infinispan. diff --git a/documentation/src/main/docbook/quickstart/en-US/content/preface.xml b/documentation/src/main/docbook/quickstart/en-US/content/preface.xml index 9df3a545bc..df2f0be01b 100644 --- a/documentation/src/main/docbook/quickstart/en-US/content/preface.xml +++ b/documentation/src/main/docbook/quickstart/en-US/content/preface.xml @@ -1,49 +1,15 @@ - - -%BOOK_ENTITIES; - -]> - - + Preface - - Working with both Object-Oriented software and Relational Databases can be cumbersome and time consuming. Development costs are significantly higher due to a paradigm mismatch between how data is represented in objects versus relational databases. Hibernate is an Object/Relational Mapping solution for Java environments. The term Object/Relational Mapping refers to the technique of mapping data between an object model representation to - a relational data model representation. See for a good high-level discussion. + a relational data model representation. See + for a good high-level discussion. @@ -56,12 +22,12 @@ Data Modeling Resources - + - + @@ -91,19 +57,19 @@ Use Hibernate and report any bugs or issues you find. See - for details. + for details. Try your hand at fixing some bugs or implementing enhancements. Again, see - . + . Engage with the community using mailing lists, forums, IRC, or other ways listed at - . + . @@ -125,7 +91,7 @@ Tutorial code The referenced projects and code for the tutorials in this guide are available at - . + .
diff --git a/documentation/src/main/docbook/quickstart/en-US/content/tutorial_annotations.xml b/documentation/src/main/docbook/quickstart/en-US/content/tutorial_annotations.xml index be6e43a159..0a551a950c 100644 --- a/documentation/src/main/docbook/quickstart/en-US/content/tutorial_annotations.xml +++ b/documentation/src/main/docbook/quickstart/en-US/content/tutorial_annotations.xml @@ -1,7 +1,6 @@ - - + Tutorial Using Native Hibernate APIs and Annotation Mappings @@ -22,7 +21,7 @@ -
+
The Hibernate configuration file @@ -32,7 +31,7 @@
-
+
The annotated entity Java class The entity class in this tutorial is org.hibernate.tutorial.annotations.Event which @@ -41,7 +40,7 @@ rather than a separate hbm.xml file. - + Identifying the class as an entity @Entity @Table( name = "EVENTS" ) @@ -60,7 +59,7 @@ public class Event { literal value, not a table as a table --> - + Identifying the identifier property @Id @GeneratedValue(generator="increment") @@ -78,7 +77,7 @@ public Long getId() { strategy for this entity's identifier values. - + Identifying basic properties public String getTitle() { return title; @@ -97,7 +96,7 @@ public Date getDate() {
-
+
Example code org.hibernate.tutorial.annotations.AnnotationsIllustrationTest is essentially the @@ -106,7 +105,7 @@ public Date getDate() {
-
+
Take it further! Practice Exercises diff --git a/documentation/src/main/docbook/quickstart/en-US/content/tutorial_envers.xml b/documentation/src/main/docbook/quickstart/en-US/content/tutorial_envers.xml index 96903c1c74..1885d3f535 100644 --- a/documentation/src/main/docbook/quickstart/en-US/content/tutorial_envers.xml +++ b/documentation/src/main/docbook/quickstart/en-US/content/tutorial_envers.xml @@ -1,7 +1,6 @@ - - + Tutorial Using Envers @@ -21,7 +20,7 @@ -
+
<filename>persistence.xml</filename> This file was discussed in the JPA tutorial in
-
+
The annotated entity Java class Again, the entity is largely the same as in . The major @@ -38,14 +37,14 @@
-
+
Example code Again, this tutorial makes use of the JPA APIs. However, the code also makes a change to one of the entities, then uses the Envers API to pull back the initial revision as well as the updated revision. A revision refers to a version of an entity. - + Using the <interfacename>org.hibernate.envers.AuditReader</interfacename> public void testBasicUsage() { ... @@ -75,7 +74,7 @@
-
+
Take it further! Practice Exercises diff --git a/documentation/src/main/docbook/quickstart/en-US/content/tutorial_jpa.xml b/documentation/src/main/docbook/quickstart/en-US/content/tutorial_jpa.xml index a2a566b2bd..4d5cf73727 100644 --- a/documentation/src/main/docbook/quickstart/en-US/content/tutorial_jpa.xml +++ b/documentation/src/main/docbook/quickstart/en-US/content/tutorial_jpa.xml @@ -1,7 +1,6 @@ - - + Tutorial Using the <firstterm><phrase>Java Persistence API (JPA)</phrase></firstterm> @@ -21,7 +20,7 @@ -
+
<filename>persistence.xml</filename> @@ -34,7 +33,7 @@ by classpath lookup of the META-INF/persistence.xml resource name. - + <filename>persistence.xml</filename>
-
+
The annotated entity Java class The entity is exactly the same as in
-
+
Example code The previous tutorials used the Hibernate APIs. This tutorial uses the JPA APIs. - + Obtaining the <interfacename>javax.persistence.EntityManagerFactory</interfacename> protected void setUp() throws Exception { entityManagerFactory = Persistence.createEntityManagerFactory( "org.hibernate.tutorial.jpa" ); @@ -90,7 +89,7 @@ - + Saving (persisting) entities EntityManager entityManager = entityManagerFactory.createEntityManager(); entityManager.getTransaction().begin(); @@ -107,7 +106,7 @@ entityManager.close(); operation persist instead of save. - + Obtaining a list of entities
-
+
Take it further! Practice Exercises diff --git a/documentation/src/main/docbook/quickstart/en-US/content/tutorial_native.xml b/documentation/src/main/docbook/quickstart/en-US/content/tutorial_native.xml index b0714781d6..feac1f7662 100644 --- a/documentation/src/main/docbook/quickstart/en-US/content/tutorial_native.xml +++ b/documentation/src/main/docbook/quickstart/en-US/content/tutorial_native.xml @@ -1,7 +1,6 @@ - - + Tutorial Using Native Hibernate APIs and <phrase>hbm.xml</phrase> Mappings @@ -22,7 +21,7 @@ -
+
The Hibernate configuration file @@ -74,7 +73,7 @@
-
+
The entity Java class The entity class for this tutorial is org.hibernate.tutorial.hbm.Event. @@ -99,7 +98,7 @@
-
+
The mapping file The hbm.xml mapping file for this tutorial is the classpath resource @@ -112,7 +111,7 @@ Hibernate mapping file is one choice for providing Hibernate with this metadata. - + The <literal>class</literal> mapping element ... @@ -141,7 +140,7 @@ EVENTS table. - + The <literal>id</literal> mapping element ... @@ -175,7 +174,7 @@ incrementing count. - + The <literal>property</literal> mapping element ]]> @@ -219,7 +218,7 @@
-
+
Example code The org.hibernate.tutorial.hbm.NativeApiIllustrationTest class illustrates using @@ -234,7 +233,7 @@ - + Obtaining the <interfacename>org.hibernate.SessionFactory</interfacename> protected void setUp() throws Exception { // A SessionFactory is set up once for an application @@ -280,7 +279,7 @@ - + Saving entities Session session = sessionFactory.openSession(); session.beginTransaction(); @@ -296,7 +295,7 @@ session.close(); takes responsibility to perform an INSERT on the database. - + Obtaining a list of entities
-
+
Take it further! Practice Exercises diff --git a/documentation/src/main/style/css/css/hibernate-eclipse.css b/documentation/src/main/style/css/css/hibernate-eclipse.css new file mode 100644 index 0000000000..25a5b9aae9 --- /dev/null +++ b/documentation/src/main/style/css/css/hibernate-eclipse.css @@ -0,0 +1,3 @@ +@import url("hibernate.css"); + +body {background-image:none;} diff --git a/documentation/src/main/style/css/css/hibernate-single.css b/documentation/src/main/style/css/css/hibernate-single.css new file mode 100644 index 0000000000..7b24266b99 --- /dev/null +++ b/documentation/src/main/style/css/css/hibernate-single.css @@ -0,0 +1,3 @@ +@import url("hibernate.css"); + +.title {margin-top:30px;} diff --git a/documentation/src/main/style/css/css/hibernate.css b/documentation/src/main/style/css/css/hibernate.css new file mode 100644 index 0000000000..d7f43026df --- /dev/null +++ b/documentation/src/main/style/css/css/hibernate.css @@ -0,0 +1,94 @@ +@import url("jbossorg.css"); + +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +/* work around problems in the jboss.org styles wrt html & jHighLight */ +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +pre { + font-family:Monaco,monospace; + line-height: 1.29em; +} + +pre br { + display:none; +} + +pre.JAVA { + line-height: 1.29em; +} + +pre.XML { + line-height: 1.29em; +} + +pre.JSP { + line-height: 1.29em; +} + +pre.XHTML { + line-height: 1.29em; +} +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +body{ + background-image:url(../images/org/hibernate/bkg_gradient.png); + font-family:'Lucida Grande', Geneva, Verdana, Arial, sans-serif; +} + +a{ + text-decoration:none; +} + +h1{ + background-image:url(../images/org/hibernate/title_hdr.png); + color:#182737; +} + +h2,h3,h4,h5,h6{ + color:#4a5d75; +} + +#title a.site_href { + display:block; + height:100px; + width:362px; + float:left; + background:url(../images/org/hibernate/hibernatelogo.png) top left no-repeat; +} + +#title a.doc_href { + display:block; + height:100px; + background:transparent url(../images/org/hibernate/community_doc.png) top right no-repeat; +} + +.releaseinfo { + color:#4a5d75; + font-size:150%; +} + +div.note { + background-color:#849092; + color:white; +} + +div.note h2 {color:white;} + +div.note a:visited, div.tip a:visited, div.important a:visited, div.caution a:visited, div.warning a:visited, div.note a:link, div.tip a:link, div.important a:link, div.caution a:link, div.warning a:link { + color: #f7f2d0; +} + +.docnav li.next a strong {background-image:url(../images/org/hibernate/docbook/next.png);} +.docnav li.previous a strong {background-image:url(../images/org/hibernate/docbook/prev.png);} +.docnav li.home a strong {background-image:url(../images/org/hibernate/docbook/home.png);} +.docnav li.up a strong {background-image:url(../images/org/hibernate/docbook/up.png);} + +/* Eclipse Help Navigation */ +.navheader td.next a {background-image:url(../images/org/hibernate/docbook/next.png);} +.navheader td.previous a {background-image:url(../images/org/hibernate/docbook/prev.png);} + +.navfooter td.next a {background-image:url(../images/org/hibernate/docbook/next.png);} +.navfooter td.previous a {background-image:url(../images/org/hibernate/docbook/prev.png);} +.navfooter td.home a {background-image:url(../images/org/hibernate/docbook/home.png);} +.navfooter td.up a {background-image:url(../images/org/hibernate/docbook/up.png);} + + diff --git a/documentation/src/main/style/images/images/org/hibernate/bkg_gradient.png b/documentation/src/main/style/images/images/org/hibernate/bkg_gradient.png new file mode 100644 index 0000000000..48365edf06 Binary files /dev/null and b/documentation/src/main/style/images/images/org/hibernate/bkg_gradient.png differ diff --git a/documentation/src/main/style/images/images/org/hibernate/community_doc.png b/documentation/src/main/style/images/images/org/hibernate/community_doc.png new file mode 100644 index 0000000000..d416cc3618 Binary files /dev/null and b/documentation/src/main/style/images/images/org/hibernate/community_doc.png differ diff --git a/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/1.png b/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/1.png new file mode 100644 index 0000000000..352500a772 Binary files /dev/null and b/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/1.png differ diff --git a/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/1.svg b/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/1.svg new file mode 100644 index 0000000000..6258b69a50 --- /dev/null +++ b/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/1.svg @@ -0,0 +1,18 @@ + + + +]> + + + + + + + + + + diff --git a/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/10.png b/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/10.png new file mode 100644 index 0000000000..c11a095d49 Binary files /dev/null and b/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/10.png differ diff --git a/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/10.svg b/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/10.svg new file mode 100644 index 0000000000..6642fa899c --- /dev/null +++ b/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/10.svg @@ -0,0 +1,23 @@ + + + +]> + + + + + + + + + + + diff --git a/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/11.png b/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/11.png new file mode 100644 index 0000000000..d550daed59 Binary files /dev/null and b/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/11.png differ diff --git a/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/11.svg b/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/11.svg new file mode 100644 index 0000000000..664171e033 --- /dev/null +++ b/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/11.svg @@ -0,0 +1,19 @@ + + + +]> + + + + + + + + + + + diff --git a/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/12.png b/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/12.png new file mode 100644 index 0000000000..05dd6d4165 Binary files /dev/null and b/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/12.png differ diff --git a/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/12.svg b/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/12.svg new file mode 100644 index 0000000000..4c4df2e6a7 --- /dev/null +++ b/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/12.svg @@ -0,0 +1,23 @@ + + + +]> + + + + + + + + + + + diff --git a/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/13.png b/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/13.png new file mode 100644 index 0000000000..11d816b6a4 Binary files /dev/null and b/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/13.png differ diff --git a/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/13.svg b/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/13.svg new file mode 100644 index 0000000000..50aa7b7d46 --- /dev/null +++ b/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/13.svg @@ -0,0 +1,25 @@ + + + +]> + + + + + + + + + + + diff --git a/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/14.png b/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/14.png new file mode 100644 index 0000000000..bd24e1b59e Binary files /dev/null and b/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/14.png differ diff --git a/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/14.svg b/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/14.svg new file mode 100644 index 0000000000..b5f1f48456 --- /dev/null +++ b/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/14.svg @@ -0,0 +1,20 @@ + + + +]> + + + + + + + + + + + diff --git a/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/15.png b/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/15.png new file mode 100644 index 0000000000..771a7db7bf Binary files /dev/null and b/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/15.png differ diff --git a/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/15.svg b/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/15.svg new file mode 100644 index 0000000000..7fe3899e67 --- /dev/null +++ b/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/15.svg @@ -0,0 +1,22 @@ + + + +]> + + + + + + + + + + + diff --git a/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/2.png b/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/2.png new file mode 100644 index 0000000000..3949673eb9 Binary files /dev/null and b/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/2.png differ diff --git a/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/2.svg b/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/2.svg new file mode 100644 index 0000000000..6a5c501bac --- /dev/null +++ b/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/2.svg @@ -0,0 +1,22 @@ + + + +]> + + + + + + + + + + diff --git a/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/3.png b/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/3.png new file mode 100644 index 0000000000..23523d9772 Binary files /dev/null and b/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/3.png differ diff --git a/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/3.svg b/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/3.svg new file mode 100644 index 0000000000..006ea01ccb --- /dev/null +++ b/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/3.svg @@ -0,0 +1,24 @@ + + + +]> + + + + + + + + + + diff --git a/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/4.png b/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/4.png new file mode 100644 index 0000000000..ced622a160 Binary files /dev/null and b/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/4.png differ diff --git a/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/4.svg b/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/4.svg new file mode 100644 index 0000000000..a532a0d1e8 --- /dev/null +++ b/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/4.svg @@ -0,0 +1,19 @@ + + + +]> + + + + + + + + + + diff --git a/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/5.png b/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/5.png new file mode 100644 index 0000000000..c117955328 Binary files /dev/null and b/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/5.png differ diff --git a/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/5.svg b/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/5.svg new file mode 100644 index 0000000000..b4bd44c187 --- /dev/null +++ b/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/5.svg @@ -0,0 +1,21 @@ + + + +]> + + + + + + + + + + diff --git a/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/6.png b/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/6.png new file mode 100644 index 0000000000..da45f300d0 Binary files /dev/null and b/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/6.png differ diff --git a/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/6.svg b/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/6.svg new file mode 100644 index 0000000000..8a44c6a437 --- /dev/null +++ b/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/6.svg @@ -0,0 +1,23 @@ + + + +]> + + + + + + + + + + diff --git a/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/7.png b/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/7.png new file mode 100644 index 0000000000..5b2d43b0d8 Binary files /dev/null and b/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/7.png differ diff --git a/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/7.svg b/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/7.svg new file mode 100644 index 0000000000..0652ed9c87 --- /dev/null +++ b/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/7.svg @@ -0,0 +1,19 @@ + + + +]> + + + + + + + + + + diff --git a/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/8.png b/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/8.png new file mode 100644 index 0000000000..067e861a63 Binary files /dev/null and b/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/8.png differ diff --git a/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/8.svg b/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/8.svg new file mode 100644 index 0000000000..dd384e1711 --- /dev/null +++ b/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/8.svg @@ -0,0 +1,24 @@ + + + +]> + + + + + + + + + + diff --git a/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/9.png b/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/9.png new file mode 100644 index 0000000000..fc1c09faaa Binary files /dev/null and b/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/9.png differ diff --git a/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/9.svg b/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/9.svg new file mode 100644 index 0000000000..40f61aed18 --- /dev/null +++ b/documentation/src/main/style/images/images/org/hibernate/docbook/callouts/9.svg @@ -0,0 +1,23 @@ + + + +]> + + + + + + + + + + diff --git a/documentation/src/main/style/images/images/org/hibernate/docbook/caution.png b/documentation/src/main/style/images/images/org/hibernate/docbook/caution.png new file mode 100644 index 0000000000..f6431e7af7 Binary files /dev/null and b/documentation/src/main/style/images/images/org/hibernate/docbook/caution.png differ diff --git a/documentation/src/main/style/images/images/org/hibernate/docbook/caution.svg b/documentation/src/main/style/images/images/org/hibernate/docbook/caution.svg new file mode 100644 index 0000000000..1a72aaf6dc --- /dev/null +++ b/documentation/src/main/style/images/images/org/hibernate/docbook/caution.svg @@ -0,0 +1,142 @@ + + + +]> + + + + + + + + + + + + + + + + + + + + + diff --git a/documentation/src/main/style/images/images/org/hibernate/docbook/home.png b/documentation/src/main/style/images/images/org/hibernate/docbook/home.png new file mode 100644 index 0000000000..50c39f3ed8 Binary files /dev/null and b/documentation/src/main/style/images/images/org/hibernate/docbook/home.png differ diff --git a/documentation/src/main/style/images/images/org/hibernate/docbook/important.png b/documentation/src/main/style/images/images/org/hibernate/docbook/important.png new file mode 100644 index 0000000000..76b90e072e Binary files /dev/null and b/documentation/src/main/style/images/images/org/hibernate/docbook/important.png differ diff --git a/documentation/src/main/style/images/images/org/hibernate/docbook/important.svg b/documentation/src/main/style/images/images/org/hibernate/docbook/important.svg new file mode 100644 index 0000000000..7c727b948a --- /dev/null +++ b/documentation/src/main/style/images/images/org/hibernate/docbook/important.svg @@ -0,0 +1,137 @@ + + + +]> + + + + + + + + + + + + + + + + + + diff --git a/documentation/src/main/style/images/images/org/hibernate/docbook/next.png b/documentation/src/main/style/images/images/org/hibernate/docbook/next.png new file mode 100644 index 0000000000..3957e327a3 Binary files /dev/null and b/documentation/src/main/style/images/images/org/hibernate/docbook/next.png differ diff --git a/documentation/src/main/style/images/images/org/hibernate/docbook/note.png b/documentation/src/main/style/images/images/org/hibernate/docbook/note.png new file mode 100644 index 0000000000..310b1da19e Binary files /dev/null and b/documentation/src/main/style/images/images/org/hibernate/docbook/note.png differ diff --git a/documentation/src/main/style/images/images/org/hibernate/docbook/note.svg b/documentation/src/main/style/images/images/org/hibernate/docbook/note.svg new file mode 100644 index 0000000000..28acab9be5 --- /dev/null +++ b/documentation/src/main/style/images/images/org/hibernate/docbook/note.svg @@ -0,0 +1,137 @@ + + + +]> + + + + + + + + + + + + + + + + + + + + + diff --git a/documentation/src/main/style/images/images/org/hibernate/docbook/prev.png b/documentation/src/main/style/images/images/org/hibernate/docbook/prev.png new file mode 100644 index 0000000000..8ee9dedc0f Binary files /dev/null and b/documentation/src/main/style/images/images/org/hibernate/docbook/prev.png differ diff --git a/documentation/src/main/style/images/images/org/hibernate/docbook/tip.png b/documentation/src/main/style/images/images/org/hibernate/docbook/tip.png new file mode 100644 index 0000000000..3b37763733 Binary files /dev/null and b/documentation/src/main/style/images/images/org/hibernate/docbook/tip.png differ diff --git a/documentation/src/main/style/images/images/org/hibernate/docbook/tip.svg b/documentation/src/main/style/images/images/org/hibernate/docbook/tip.svg new file mode 100644 index 0000000000..4c876bbf04 --- /dev/null +++ b/documentation/src/main/style/images/images/org/hibernate/docbook/tip.svg @@ -0,0 +1,143 @@ + + + +]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/documentation/src/main/style/images/images/org/hibernate/docbook/up.png b/documentation/src/main/style/images/images/org/hibernate/docbook/up.png new file mode 100644 index 0000000000..0612e13cd6 Binary files /dev/null and b/documentation/src/main/style/images/images/org/hibernate/docbook/up.png differ diff --git a/documentation/src/main/style/images/images/org/hibernate/docbook/warning.png b/documentation/src/main/style/images/images/org/hibernate/docbook/warning.png new file mode 100644 index 0000000000..be2b415a6e Binary files /dev/null and b/documentation/src/main/style/images/images/org/hibernate/docbook/warning.png differ diff --git a/documentation/src/main/style/images/images/org/hibernate/docbook/warning.svg b/documentation/src/main/style/images/images/org/hibernate/docbook/warning.svg new file mode 100644 index 0000000000..894b958508 --- /dev/null +++ b/documentation/src/main/style/images/images/org/hibernate/docbook/warning.svg @@ -0,0 +1,231 @@ + + + +]> + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/documentation/src/main/style/images/images/org/hibernate/dot.png b/documentation/src/main/style/images/images/org/hibernate/dot.png new file mode 100755 index 0000000000..079add95de Binary files /dev/null and b/documentation/src/main/style/images/images/org/hibernate/dot.png differ diff --git a/documentation/src/main/style/images/images/org/hibernate/dot2.png b/documentation/src/main/style/images/images/org/hibernate/dot2.png new file mode 100755 index 0000000000..8348fcd054 Binary files /dev/null and b/documentation/src/main/style/images/images/org/hibernate/dot2.png differ diff --git a/documentation/src/main/style/images/images/org/hibernate/hibernatelogo.png b/documentation/src/main/style/images/images/org/hibernate/hibernatelogo.png new file mode 100644 index 0000000000..47c4dbe840 Binary files /dev/null and b/documentation/src/main/style/images/images/org/hibernate/hibernatelogo.png differ diff --git a/documentation/src/main/style/images/images/org/hibernate/title_hdr.png b/documentation/src/main/style/images/images/org/hibernate/title_hdr.png new file mode 100644 index 0000000000..0c801672ce Binary files /dev/null and b/documentation/src/main/style/images/images/org/hibernate/title_hdr.png differ diff --git a/documentation/src/main/style/xslt/org/hibernate/jdocbook/xslt/common.xsl b/documentation/src/main/style/xslt/org/hibernate/jdocbook/xslt/common.xsl new file mode 100644 index 0000000000..d89d5a51ab --- /dev/null +++ b/documentation/src/main/style/xslt/org/hibernate/jdocbook/xslt/common.xsl @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + images/org/hibernate/docbook/callouts/ + + + + + + + images/org/hibernate/docbook/ + + + + diff --git a/documentation/src/main/style/xslt/org/hibernate/jdocbook/xslt/eclipse.xsl b/documentation/src/main/style/xslt/org/hibernate/jdocbook/xslt/eclipse.xsl new file mode 100644 index 0000000000..fc68d5f1d0 --- /dev/null +++ b/documentation/src/main/style/xslt/org/hibernate/jdocbook/xslt/eclipse.xsl @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + Hibernate Help + org.hibernate.help + Hibernate.org + + + diff --git a/documentation/src/main/style/xslt/org/hibernate/jdocbook/xslt/fop1.xsl b/documentation/src/main/style/xslt/org/hibernate/jdocbook/xslt/fop1.xsl new file mode 100644 index 0000000000..629d080633 --- /dev/null +++ b/documentation/src/main/style/xslt/org/hibernate/jdocbook/xslt/fop1.xsl @@ -0,0 +1,100 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/documentation/src/main/style/xslt/org/hibernate/jdocbook/xslt/pdf.xsl b/documentation/src/main/style/xslt/org/hibernate/jdocbook/xslt/pdf.xsl new file mode 100644 index 0000000000..aa2a8e07a0 --- /dev/null +++ b/documentation/src/main/style/xslt/org/hibernate/jdocbook/xslt/pdf.xsl @@ -0,0 +1,137 @@ + + + + + + + + + + + + + + + + + + + + + + + + Setting 'title.font.family' param = + + + + + + + + + + Setting 'body.font.family' param = + + + + + + + + + + Setting 'monospace.font.family' param = + + + + + + + + + + Setting 'sans.font.family' param = + + + + + + #4a5d75 + #4a5d75 + #4a5d75 + #4a5d75 + + + + + + + bold + #EDE8DB + black + + + + + + + + + + + + + + + + + + + #EDE8DB + + + + + diff --git a/documentation/src/main/style/xslt/org/hibernate/jdocbook/xslt/xhtml-common.xsl b/documentation/src/main/style/xslt/org/hibernate/jdocbook/xslt/xhtml-common.xsl new file mode 100644 index 0000000000..dd4adddb54 --- /dev/null +++ b/documentation/src/main/style/xslt/org/hibernate/jdocbook/xslt/xhtml-common.xsl @@ -0,0 +1,58 @@ + + + + + + + + + + legalnotice.html + + + + + + +
+ + + + + + + + + + + + + +
+ +
diff --git a/documentation/src/main/style/xslt/org/hibernate/jdocbook/xslt/xhtml-single.xsl b/documentation/src/main/style/xslt/org/hibernate/jdocbook/xslt/xhtml-single.xsl new file mode 100644 index 0000000000..f38cc42115 --- /dev/null +++ b/documentation/src/main/style/xslt/org/hibernate/jdocbook/xslt/xhtml-single.xsl @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + diff --git a/documentation/src/main/style/xslt/org/hibernate/jdocbook/xslt/xhtml.xsl b/documentation/src/main/style/xslt/org/hibernate/jdocbook/xslt/xhtml.xsl new file mode 100644 index 0000000000..5b855b8985 --- /dev/null +++ b/documentation/src/main/style/xslt/org/hibernate/jdocbook/xslt/xhtml.xsl @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + diff --git a/hibernate-core/hibernate-core.gradle b/hibernate-core/hibernate-core.gradle index d8dee4f889..99a98e867f 100644 --- a/hibernate-core/hibernate-core.gradle +++ b/hibernate-core/hibernate-core.gradle @@ -59,10 +59,12 @@ sourceSets.test.resources { setSrcDirs( ['src/test/java','src/test/resources'] ) } -ideaModule { - sourceDirs += file( '$buildDir/generated-src/antlr/main' ) - testSourceDirs += file( 'src/matrix/java') - testSourceDirs += file( 'src/matrix/resources') +idea { + module { + sourceDirs += file( '$buildDir/generated-src/antlr/main' ) + testSourceDirs += file( 'src/matrix/java') + testSourceDirs += file( 'src/matrix/resources') + } } task jaxb { diff --git a/hibernate-entitymanager/hibernate-entitymanager.gradle b/hibernate-entitymanager/hibernate-entitymanager.gradle index 435c4fcf60..5b1b643931 100644 --- a/hibernate-entitymanager/hibernate-entitymanager.gradle +++ b/hibernate-entitymanager/hibernate-entitymanager.gradle @@ -1,20 +1,8 @@ import org.apache.tools.ant.filters.ReplaceTokens apply plugin: 'java' -apply plugin: "jdocbook" apply plugin: org.hibernate.build.gradle.testing.matrix.MatrixTestingPlugin -buildscript { - repositories { - mavenCentral() - mavenLocal() - mavenRepo name: "jboss", urls: "http://repository.jboss.org/nexus/content/groups/public/" - } - dependencies { - classpath 'org.jboss.jdocbook:gradle-jdocbook:1.1.0' - } -} - dependencies { compile( project(':hibernate-core') ) compile( libraries.dom4j ) @@ -28,7 +16,6 @@ dependencies { testCompile( libraries.shrinkwrap ) testCompile( libraries.validation ) testRuntime( libraries.validator ) - jdocbookStyles "org.hibernate:hibernate-jdocbook-style:2.0.1" } sourceSets { @@ -127,21 +114,9 @@ task copyBundleResources (type: Copy) { // make sure that the bundles for the packaged test (PackagingTestCase) are copied as well processTestResources.dependsOn copyBundleResources -jdocbook { - format('html_single') { - finalName = "index.html" - stylesheet = "classpath:/xslt/org/hibernate/jdocbook/xslt/xhtml-single.xsl" +idea { + module { + testSourceDirs += file( 'src/matrix/java') + testSourceDirs += file( 'src/matrix/resources') } - format('html') { - finalName = "index.html" - stylesheet = "classpath:/xslt/org/hibernate/jdocbook/xslt/xhtml.xsl" - } - masterSourceDocumentName="master.xml" - masterLanguage="en" } - -ideaModule { - excludeDirs += file("$buildDir/bundles") - testSourceDirs += file( 'src/matrix/java') - testSourceDirs += file( 'src/matrix/resources') -} \ No newline at end of file diff --git a/hibernate-envers/hibernate-envers.gradle b/hibernate-envers/hibernate-envers.gradle index aa29492ebe..ee87491c93 100644 --- a/hibernate-envers/hibernate-envers.gradle +++ b/hibernate-envers/hibernate-envers.gradle @@ -29,7 +29,10 @@ sourceSets { } } compileMatrixJava.options.define(compilerArgs: ["-proc:none", "-encoding", "UTF-8"]) -ideaModule { - testSourceDirs += file( 'src/matrix/java') - testSourceDirs += file( 'src/matrix/resources') + +idea { + module { + testSourceDirs += file( 'src/matrix/java') + testSourceDirs += file( 'src/matrix/resources') + } } diff --git a/release/release.gradle b/release/release.gradle index 1f1e5820ff..4c19eec677 100644 --- a/release/release.gradle +++ b/release/release.gradle @@ -3,7 +3,7 @@ apply plugin: 'idea' buildDir = "target" -ideaModule { +idea.module { }