Apply changes needed for support of @ValueGenerationType in Hibernate Reactive

This commit is contained in:
Georgios Andrianakis 2023-02-17 13:14:34 +02:00 committed by Christian Beikov
parent 7e83dba91f
commit 6b2281d0ba
3 changed files with 34 additions and 4 deletions

View File

@ -139,4 +139,24 @@ public class GeneratedValuesProcessor {
attribute.getAttributeMetadata().getPropertyAccess().getSetter().set( entity, generatedValue );
}
}
public SelectStatement getSelectStatement() {
return selectStatement;
}
public List<AttributeMapping> getGeneratedValuesToSelect() {
return generatedValuesToSelect;
}
public List<JdbcParameter> getJdbcParameters() {
return jdbcParameters;
}
public EntityMappingType getEntityDescriptor() {
return entityDescriptor;
}
public SessionFactoryImplementor getSessionFactory() {
return sessionFactory;
}
}

View File

@ -1000,6 +1000,16 @@ public abstract class AbstractEntityPersister
return sqlVersionSelectString;
}
@Internal
public GeneratedValuesProcessor getInsertGeneratedValuesProcessor() {
return insertGeneratedValuesProcessor;
}
@Internal
public GeneratedValuesProcessor getUpdateGeneratedValuesProcessor() {
return updateGeneratedValuesProcessor;
}
@Override
public boolean hasRowId() {
return rowIdName != null;

View File

@ -222,7 +222,7 @@ public class UpdateCoordinatorStandard extends AbstractMutationCoordinator imple
);
}
private void performUpdate(
protected void performUpdate(
Object entity,
Object id,
Object rowId,
@ -300,7 +300,7 @@ public class UpdateCoordinatorStandard extends AbstractMutationCoordinator imple
}
}
private static int[] dirtyAttributeIndexes(int[] incomingDirtyIndexes, int[] preUpdateGeneratedIndexes) {
protected static int[] dirtyAttributeIndexes(int[] incomingDirtyIndexes, int[] preUpdateGeneratedIndexes) {
if ( preUpdateGeneratedIndexes.length == 0 ) {
return incomingDirtyIndexes;
}
@ -362,7 +362,7 @@ public class UpdateCoordinatorStandard extends AbstractMutationCoordinator imple
}
}
private boolean handlePotentialImplicitForcedVersionIncrement(
protected boolean handlePotentialImplicitForcedVersionIncrement(
Object entity,
Object id,
Object[] values,
@ -538,7 +538,7 @@ public class UpdateCoordinatorStandard extends AbstractMutationCoordinator imple
* Transform the array of property indexes to an array of booleans for each attribute,
* true when the property is dirty
*/
private boolean[] getPropertiesToUpdate(final int[] dirtyProperties, final boolean hasDirtyCollection) {
protected boolean[] getPropertiesToUpdate(final int[] dirtyProperties, final boolean hasDirtyCollection) {
final boolean[] updateability = entityPersister().getPropertyUpdateability();
if ( dirtyProperties == null ) {
return updateability;