From 5963dc7fe85aefaa280f9de46e7623b47003fe42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9da=20Housni=20Alaoui?= Date: Fri, 24 Apr 2020 16:46:20 +0200 Subject: [PATCH 1/2] HHH-13980 NullPointerException on AbstractEntityGraphVisitationStrategy.startingCollectionIndex --- .../AbstractEntityGraphVisitationStrategy.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/loader/plan/build/internal/AbstractEntityGraphVisitationStrategy.java b/hibernate-core/src/main/java/org/hibernate/loader/plan/build/internal/AbstractEntityGraphVisitationStrategy.java index dca4db7898..b19de4c36c 100644 --- a/hibernate-core/src/main/java/org/hibernate/loader/plan/build/internal/AbstractEntityGraphVisitationStrategy.java +++ b/hibernate-core/src/main/java/org/hibernate/loader/plan/build/internal/AbstractEntityGraphVisitationStrategy.java @@ -180,10 +180,12 @@ public abstract class AbstractEntityGraphVisitationStrategy AttributeNodeImplementor attributeNode = attributeStack.getCurrent(); GraphImplementor subGraphNode = null; - Map subGraphs = attributeNode.getKeySubgraphs(); - Class javaType = indexDefinition.getType().getReturnedClass(); - if ( !subGraphs.isEmpty() && subGraphs.containsKey( javaType ) ) { - subGraphNode = (GraphImplementor) subGraphs.get( javaType ); + if ( attributeNode != null ) { + Map subGraphs = attributeNode.getKeySubgraphs(); + Class javaType = indexDefinition.getType().getReturnedClass(); + if (!subGraphs.isEmpty() && subGraphs.containsKey(javaType)) { + subGraphNode = (GraphImplementor) subGraphs.get(javaType); + } } graphStack.push( subGraphNode ); From 180656e9f37f49cbdf55bdbdd667439e73fe4d5f Mon Sep 17 00:00:00 2001 From: Martin Vietz Date: Sat, 14 Dec 2019 01:28:49 +0100 Subject: [PATCH 2/2] HHH-14064 - Fix documentation for schema-generation --- .../main/asciidoc/userguide/appendices/Configurations.adoc | 2 +- .../src/main/java/org/hibernate/tool/schema/SourceType.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/documentation/src/main/asciidoc/userguide/appendices/Configurations.adoc b/documentation/src/main/asciidoc/userguide/appendices/Configurations.adoc index 9e5c0b66cf..fba33d8d8f 100644 --- a/documentation/src/main/asciidoc/userguide/appendices/Configurations.adoc +++ b/documentation/src/main/asciidoc/userguide/appendices/Configurations.adoc @@ -832,7 +832,7 @@ See https://docs.jboss.org/hibernate/orm/{majorMinorVersion}/javadocs/org/hibern + If no value is specified, a default is assumed as follows: + -* if source scripts are specified (per `javax.persistence.schema-generation.create-script-source`), then the `script` option is assumed +* if source scripts are specified (per `javax.persistence.schema-generation.drop-script-source`), then the `script` option is assumed * otherwise, `metadata` is assumed `*javax.persistence.schema-generation.create-script-source*`:: diff --git a/hibernate-core/src/main/java/org/hibernate/tool/schema/SourceType.java b/hibernate-core/src/main/java/org/hibernate/tool/schema/SourceType.java index 7755edd9a2..6fbe960643 100644 --- a/hibernate-core/src/main/java/org/hibernate/tool/schema/SourceType.java +++ b/hibernate-core/src/main/java/org/hibernate/tool/schema/SourceType.java @@ -34,7 +34,7 @@ public enum SourceType { */ SCRIPT( "script" ), /** - * "metadata-then-scripts" - Both the O/RM metadata and external DDL scripts are used as sources for generation, + * "metadata-then-script" - Both the O/RM metadata and external DDL scripts are used as sources for generation, * with the O/RM metadata being applied first. * * @see #METADATA @@ -42,7 +42,7 @@ public enum SourceType { */ METADATA_THEN_SCRIPT( "metadata-then-script" ), /** - * "scripts-then-metadata" - Both the O/RM metadata and external DDL scripts are used as sources for generation, + * "script-then-metadata" - Both the O/RM metadata and external DDL scripts are used as sources for generation, * with the commands from the external DDL script(s) being applied first * * @see #SCRIPT