Skip to content

Commit a842e54

Browse files
committed
some cleanups in persisters
(and a very minor bugfix)
1 parent 1b581a0 commit a842e54

File tree

5 files changed

+246
-268
lines changed

5 files changed

+246
-268
lines changed

hibernate-core/src/main/java/org/hibernate/generator/internal/TenantIdGeneration.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,12 @@ public class TenantIdGeneration implements BeforeExecutionGenerator {
2929
private final String propertyName;
3030

3131
public TenantIdGeneration(TenantId annotation, Member member, GeneratorCreationContext context) {
32-
entityName = context.getPersistentClass() == null
33-
? member.getDeclaringClass().getName() //it's an attribute of an embeddable
34-
: context.getPersistentClass().getEntityName();
32+
final var persistentClass = context.getPersistentClass();
33+
entityName =
34+
persistentClass != null
35+
? persistentClass.getEntityName()
36+
// it's an attribute of an embeddable
37+
: member.getDeclaringClass().getName();
3538
propertyName = context.getProperty().getName();
3639
}
3740

0 commit comments

Comments
 (0)