Skip to content

Commit d95e14a

Browse files
committed
make a field final in EntityMetamodel
1 parent 95bb4a7 commit d95e14a

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

hibernate-core/src/main/java/org/hibernate/tuple/entity/EntityMetamodel.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public class EntityMetamodel implements Serializable {
8383

8484
private final String name;
8585
private final String rootName;
86-
private EntityType entityType;
86+
private final EntityType entityType;
8787

8888
private final int subclassId;
8989
private final IdentifierProperty identifierAttribute;
@@ -175,6 +175,8 @@ public EntityMetamodel(
175175
//noinspection ResultOfMethodCallIgnored
176176
rootName.hashCode();
177177

178+
entityType = new ManyToOneType( name, creationContext.getTypeConfiguration() );
179+
178180
subclassId = persistentClass.getSubclassId();
179181

180182
identifierAttribute =
@@ -755,9 +757,6 @@ public int getSubclassId() {
755757
}
756758

757759
public EntityType getEntityType() {
758-
if ( entityType == null ) {
759-
entityType = new ManyToOneType( name, getSessionFactory().getTypeConfiguration() );
760-
}
761760
return entityType;
762761
}
763762

0 commit comments

Comments
 (0)