diff --git a/documentation/documentation.gradle b/documentation/documentation.gradle index 9773ba181699..0501ba2172b4 100644 --- a/documentation/documentation.gradle +++ b/documentation/documentation.gradle @@ -264,6 +264,8 @@ asciidoctorj { 'html-meta-version-family': ormBuildDetails.hibernateVersion.family options logDocuments: true + + fatalWarnings(missingIncludes()) } diff --git a/documentation/src/main/asciidoc/userguide/chapters/domain/entity.adoc b/documentation/src/main/asciidoc/userguide/chapters/domain/entity.adoc index 40f24511ebed..663e210e05e8 100644 --- a/documentation/src/main/asciidoc/userguide/chapters/domain/entity.adoc +++ b/documentation/src/main/asciidoc/userguide/chapters/domain/entity.adoc @@ -470,7 +470,7 @@ The https://docs.hibernate.org/orm/{majorMinorVersion}/javadocs/org/hibernate/an ==== [source,java] ---- -include::{example-dir-proxy}/concrete/AbstractConcreteProxyTest.java[tag=entity-concrete-proxy-mapping,indent=0] +include::{example-dir-proxy}/concrete/ConcreteProxyTest.java[tag=entity-concrete-proxy-mapping,indent=0] ---- ==== @@ -481,7 +481,7 @@ In the following example we load the parent's lazy association and resolve to th ==== [source,java] ---- -include::{example-dir-proxy}/concrete/AbstractConcreteProxyTest.java[tag=entity-concrete-proxy-find,indent=0] +include::{example-dir-proxy}/concrete/ConcreteProxyTest.java[tag=entity-concrete-proxy-find,indent=0] ---- [source,sql] @@ -505,7 +505,7 @@ In the following example, you can see how Hibernate issues a query to resolve th ==== [source,java] ---- -include::{example-dir-proxy}/concrete/AbstractConcreteProxyTest.java[tag=entity-concrete-proxy-reference,indent=0] +include::{example-dir-proxy}/concrete/ConcreteProxyTest.java[tag=entity-concrete-proxy-reference,indent=0] ---- [source,sql] diff --git a/documentation/src/main/asciidoc/userguide/chapters/pc/PersistenceContext.adoc b/documentation/src/main/asciidoc/userguide/chapters/pc/PersistenceContext.adoc index 9bb14456fe9a..7d509012e04f 100644 --- a/documentation/src/main/asciidoc/userguide/chapters/pc/PersistenceContext.adoc +++ b/documentation/src/main/asciidoc/userguide/chapters/pc/PersistenceContext.adoc @@ -584,7 +584,7 @@ if the `@Filter` defines a condition that uses predicates across multiple tables ==== [source, java, indent=0] ---- -include::{example-dir-pc}/FilterSqlFragementAliasTest.java[tags=pc-filter-sql-fragment-alias-example] +include::{example-dir-pc}/FilterSqlFragmentAliasTest.java[tags=pc-filter-sql-fragment-alias-example] ---- ==== @@ -596,7 +596,7 @@ Hibernate is going to apply the right table aliases to the filter predicates: ==== [source, java, indent=0] ---- -include::{example-dir-pc}/FilterSqlFragementAliasTest.java[tags=pc-filter-sql-fragment-alias-query-example] +include::{example-dir-pc}/FilterSqlFragmentAliasTest.java[tags=pc-filter-sql-fragment-alias-query-example] ---- [source, sql, indent=0] diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/basic/bitset/BitSetTypeTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/basic/bitset/BitSetTypeTest.java index 6d3521b53ed0..f018bf4a9353 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/basic/bitset/BitSetTypeTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/mapping/basic/bitset/BitSetTypeTest.java @@ -10,6 +10,9 @@ import org.hibernate.annotations.Parameter; import org.hibernate.annotations.Type; +import org.hibernate.boot.MetadataBuilder; +import org.hibernate.boot.MetadataSources; +import org.hibernate.boot.registry.StandardServiceRegistryBuilder; import org.hibernate.testing.orm.junit.DomainModel; import org.hibernate.testing.orm.junit.ServiceRegistry; import org.hibernate.testing.orm.junit.SessionFactory; @@ -37,6 +40,22 @@ public void cleanup(SessionFactoryScope scope) { scope.getSessionFactory().getSchemaManager().truncateMappedObjects(); } + /* + * We don't need this code for the test itself but we need to include it in the ref doc. + */ + public void ignoredJustForIncludeInSources() { + try (org.hibernate.service.ServiceRegistry standardRegistry = new StandardServiceRegistryBuilder().build()) { + //tag::basic-custom-type-register-BasicType-example[] + MetadataSources sources = new MetadataSources( standardRegistry ); + MetadataBuilder metadataBuilder = sources.getMetadataBuilder(); + metadataBuilder.applyBasicType( BitSetType.INSTANCE ); + //end::basic-custom-type-register-BasicType-example[] + } + catch (Exception ignore) { + + } + } + @Test public void test(SessionFactoryScope scope) {