Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4646,7 +4646,7 @@ private void prepareMappings(MappingModelCreationProcess creationProcess) {
creationProcess.getCreationContext().getBootModel()
.getEntityBinding( getEntityName() );
initializeSpecialAttributeMappings( creationProcess, persistentClass );
versionGenerator = createVersionGenerator( this, versionMapping );
versionGenerator = createVersionGenerator( super.getVersionGenerator(), versionMapping );
buildDeclaredAttributeMappings( creationProcess, persistentClass );
getAttributeMappings();
initializeNaturalIdMapping( creationProcess, persistentClass );
Expand Down Expand Up @@ -4705,15 +4705,15 @@ private void inheritSupertypeSpecialAttributeMappings() {
}
}

private static BeforeExecutionGenerator createVersionGenerator
(EntityMetamodel currentEntityMetamodel, EntityVersionMapping versionMapping) {
if ( currentEntityMetamodel.isVersioned() ) {
final var generator = currentEntityMetamodel.getVersionGenerator();
private static @Nullable BeforeExecutionGenerator createVersionGenerator(
@Nullable BeforeExecutionGenerator configuredGenerator,
@Nullable EntityVersionMapping versionMapping) {
if ( versionMapping != null ) {
// need to do this here because EntityMetamodel doesn't have the EntityVersionMapping :-(
return generator == null ? new VersionGeneration( versionMapping ) : generator;
return configuredGenerator == null ? new VersionGeneration( versionMapping ) : configuredGenerator;
}
else {
return null;
return configuredGenerator;
}
}

Expand Down
Loading