Get rid of capturing lambdas for Bindable#JdbcValueConsumer

This commit is contained in:
Christian Beikov 2023-02-10 11:49:36 +01:00
parent 15b24d6c14
commit 4c99dbb75c
44 changed files with 401 additions and 184 deletions

View File

@ -187,10 +187,12 @@ public abstract class AbstractCompositeIdentifierMapping
} }
@Override @Override
public int forEachJdbcValue( public <X, Y> int forEachJdbcValue(
Object value, Object value,
int offset, int offset,
JdbcValuesConsumer valuesConsumer, X x,
Y y,
JdbcValuesBiConsumer<X, Y> valuesConsumer,
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
int span = 0; int span = 0;
final EmbeddableMappingType embeddableTypeDescriptor = getEmbeddableTypeDescriptor(); final EmbeddableMappingType embeddableTypeDescriptor = getEmbeddableTypeDescriptor();
@ -209,12 +211,14 @@ public abstract class AbstractCompositeIdentifierMapping
span += fkDescriptor.forEachJdbcValue( span += fkDescriptor.forEachJdbcValue(
identifier, identifier,
span + offset, span + offset,
x,
y,
valuesConsumer, valuesConsumer,
session session
); );
} }
else { else {
span += attributeMapping.forEachJdbcValue( o, span + offset, valuesConsumer, session ); span += attributeMapping.forEachJdbcValue( o, span + offset, x, y, valuesConsumer, session );
} }
} }
return span; return span;

View File

@ -111,51 +111,131 @@ public interface Bindable extends JdbcMappingContainer {
* consumer.consume( 28 ); * consumer.consume( 28 );
* ```` * ````
* *
* Think of it as breaking the multi-dimensional array into a visitable flat array * Think of it as breaking the multi-dimensional array into a visitable flat array.
* Additionally, it passes through the values {@code X} and {@code Y} to the consumer.
*/
default <X, Y> int forEachDisassembledJdbcValue(
Object value,
X x,
Y y,
JdbcValuesBiConsumer<X, Y> valuesConsumer,
SharedSessionContractImplementor session) {
return forEachDisassembledJdbcValue( value, 0, x, y, valuesConsumer, session );
}
/**
* Like {@link #forEachDisassembledJdbcValue(Object, Object, Object, JdbcValuesBiConsumer, SharedSessionContractImplementor)},
* but additionally receives an offset by which the selectionIndex is incremented when calling {@link JdbcValuesBiConsumer#consume(int, Object, Object, Object, JdbcMapping)}.
*/
<X, Y> int forEachDisassembledJdbcValue(
Object value,
int offset,
X x,
Y y,
JdbcValuesBiConsumer<X, Y> valuesConsumer,
SharedSessionContractImplementor session);
/**
* A short hand form of {@link #forEachDisassembledJdbcValue(Object, Object, Object, JdbcValuesBiConsumer, SharedSessionContractImplementor)},
* that passes null for the two values {@code X} and {@code Y}.
*/ */
default int forEachDisassembledJdbcValue( default int forEachDisassembledJdbcValue(
Object value, Object value,
JdbcValuesConsumer valuesConsumer, JdbcValuesConsumer valuesConsumer,
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
return forEachDisassembledJdbcValue( value, 0, valuesConsumer, session ); return forEachDisassembledJdbcValue( value, null, null, valuesConsumer, session );
} }
int forEachDisassembledJdbcValue( /**
* A short hand form of {@link #forEachDisassembledJdbcValue(Object, int, Object, Object, JdbcValuesBiConsumer, SharedSessionContractImplementor)},
* that passes null for the two values {@code X} and {@code Y} .
*/
default int forEachDisassembledJdbcValue(
Object value, Object value,
int offset, int offset,
JdbcValuesConsumer valuesConsumer, JdbcValuesConsumer valuesConsumer,
SharedSessionContractImplementor session); SharedSessionContractImplementor session) {
return forEachDisassembledJdbcValue( value, offset, null, null, valuesConsumer, session );
}
/** /**
* Visit each constituent JDBC value extracted from the entity instance itself. * Visit each constituent JDBC value extracted from the entity instance itself.
* *
* Short-hand form of calling {@link #disassemble} and piping its result to * Short-hand form of calling {@link #disassemble} and piping its result to
* {@link #forEachDisassembledJdbcValue} * {@link #forEachDisassembledJdbcValue(Object, JdbcValuesConsumer, SharedSessionContractImplementor)}
*/
default <X, Y> int forEachJdbcValue(
Object value,
X x,
Y y,
JdbcValuesBiConsumer<X, Y> valuesConsumer,
SharedSessionContractImplementor session) {
return forEachJdbcValue( value, 0, x, y, valuesConsumer, session );
}
/**
* Visit each constituent JDBC value extracted from the entity instance itself.
*
* Short-hand form of calling {@link #disassemble} and piping its result to
* {@link #forEachDisassembledJdbcValue(Object, int, JdbcValuesConsumer, SharedSessionContractImplementor)}
*/
default <X, Y> int forEachJdbcValue(
Object value,
int offset,
X x,
Y y,
JdbcValuesBiConsumer<X, Y> valuesConsumer,
SharedSessionContractImplementor session) {
return forEachDisassembledJdbcValue( disassemble( value, session ), offset, x, y, valuesConsumer, session );
}
/**
* A short hand form of {@link #forEachJdbcValue(Object, Object, Object, JdbcValuesBiConsumer, SharedSessionContractImplementor)},
* that passes null for the two values {@code X} and {@code Y}.
*/ */
default int forEachJdbcValue( default int forEachJdbcValue(
Object value, Object value,
JdbcValuesConsumer valuesConsumer, JdbcValuesConsumer valuesConsumer,
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
return forEachJdbcValue( value, 0, valuesConsumer, session ); return forEachJdbcValue( value, null, null, valuesConsumer, session );
} }
/**
* A short hand form of {@link #forEachJdbcValue(Object, int, Object, Object, JdbcValuesBiConsumer, SharedSessionContractImplementor)},
* that passes null for the two values {@code X} and {@code Y}.
*/
default int forEachJdbcValue( default int forEachJdbcValue(
Object value, Object value,
int offset, int offset,
JdbcValuesConsumer valuesConsumer, JdbcValuesConsumer valuesConsumer,
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
return forEachDisassembledJdbcValue( disassemble( value, session ), offset, valuesConsumer, session ); return forEachJdbcValue( value, offset, null, null, valuesConsumer, session );
} }
/** /**
* Functional interface for consuming the JDBC values. Essentially a {@link java.util.function.BiConsumer} * Functional interface for consuming the JDBC values.
*/ */
@FunctionalInterface @FunctionalInterface
interface JdbcValuesConsumer { interface JdbcValuesConsumer extends JdbcValuesBiConsumer<Object, Object> {
@Override
default void consume(int selectionIndex, Object o, Object o2, Object jdbcValue, JdbcMapping jdbcMapping) {
consume( selectionIndex, jdbcValue, jdbcMapping );
}
/** /**
* Consume a JDBC-level jdbcValue. The JDBC jdbcMapping descriptor is also passed in * Consume a JDBC-level jdbcValue. The JDBC jdbcMapping descriptor is also passed in
*/ */
void consume(int selectionIndex, Object jdbcValue, JdbcMapping jdbcMapping); void consume(int selectionIndex, Object jdbcValue, JdbcMapping jdbcMapping);
} }
/**
* Functional interface for consuming the JDBC values, along with two values of type {@code X} and {@code Y}.
*/
@FunctionalInterface
interface JdbcValuesBiConsumer<X, Y> {
/**
* Consume a JDBC-level jdbcValue. The JDBC jdbcMapping descriptor is also passed in
*/
void consume(int selectionIndex, X x, Y y, Object jdbcValue, JdbcMapping jdbcMapping);
}
} }

View File

@ -72,12 +72,14 @@ public interface EmbeddableValuedModelPart extends ValuedModelPart, Fetchable, F
} }
@Override @Override
default int forEachJdbcValue( default <X, Y> int forEachJdbcValue(
Object value, Object value,
int offset, int offset,
JdbcValuesConsumer valuesConsumer, X x,
Y y,
JdbcValuesBiConsumer<X, Y> valuesConsumer,
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
return getEmbeddableTypeDescriptor().forEachJdbcValue( value, offset, valuesConsumer, session ); return getEmbeddableTypeDescriptor().forEachJdbcValue( value, offset, x, y, valuesConsumer, session );
} }
@Override @Override
@ -91,14 +93,18 @@ public interface EmbeddableValuedModelPart extends ValuedModelPart, Fetchable, F
} }
@Override @Override
default int forEachDisassembledJdbcValue( default <X, Y> int forEachDisassembledJdbcValue(
Object value, Object value,
int offset, int offset,
JdbcValuesConsumer valuesConsumer, X x,
Y y,
JdbcValuesBiConsumer<X, Y> valuesConsumer,
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
return getEmbeddableTypeDescriptor().forEachDisassembledJdbcValue( return getEmbeddableTypeDescriptor().forEachDisassembledJdbcValue(
value, value,
offset, offset,
x,
y,
valuesConsumer, valuesConsumer,
session session
); );

View File

@ -101,20 +101,24 @@ public interface EntityValuedModelPart extends FetchableContainer {
} }
@Override @Override
default int forEachDisassembledJdbcValue( default <X, Y> int forEachDisassembledJdbcValue(
Object value, Object value,
int offset, int offset,
JdbcValuesConsumer valuesConsumer, X x,
Y y,
JdbcValuesBiConsumer<X, Y> valuesConsumer,
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
return getEntityMappingType().forEachDisassembledJdbcValue( value, offset, valuesConsumer, session ); return getEntityMappingType().forEachDisassembledJdbcValue( value, offset, x, y, valuesConsumer, session );
} }
@Override @Override
default int forEachJdbcValue( default <X, Y> int forEachJdbcValue(
Object value, Object value,
int offset, int offset,
JdbcValuesConsumer consumer, X x,
Y y,
JdbcValuesBiConsumer<X, Y> consumer,
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
return getEntityMappingType().forEachJdbcValue( value, offset, consumer, session ); return getEntityMappingType().forEachJdbcValue( value, offset, x, y, consumer, session );
} }
} }

View File

@ -221,12 +221,14 @@ public abstract class AbstractDiscriminatorMapping implements EntityDiscriminato
} }
@Override @Override
public int forEachDisassembledJdbcValue( public <X, Y> int forEachDisassembledJdbcValue(
Object value, Object value,
int offset, int offset,
JdbcValuesConsumer valuesConsumer, X x,
Y y,
JdbcValuesBiConsumer<X, Y> valuesConsumer,
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
valuesConsumer.consume( offset, value, jdbcMapping ); valuesConsumer.consume( offset, x, y, value, jdbcMapping );
return getJdbcTypeCount(); return getJdbcTypeCount();
} }

View File

@ -214,10 +214,12 @@ public class AnyDiscriminatorPart implements BasicValuedModelPart, FetchOptions,
} }
@Override @Override
public int forEachDisassembledJdbcValue( public <X, Y> int forEachDisassembledJdbcValue(
Object value, Object value,
int offset, int offset,
JdbcValuesConsumer valuesConsumer, X x,
Y y,
JdbcValuesBiConsumer<X, Y> valuesConsumer,
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }

View File

@ -270,12 +270,14 @@ public class AnyKeyPart implements BasicValuedModelPart, FetchOptions {
} }
@Override @Override
public int forEachJdbcValue( public <X, Y> int forEachJdbcValue(
Object value, Object value,
int offset, int offset,
JdbcValuesConsumer valuesConsumer, X x,
Y y,
JdbcValuesBiConsumer<X, Y> valuesConsumer,
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
valuesConsumer.consume( offset, value, jdbcMapping ); valuesConsumer.consume( offset, x, y, value, jdbcMapping );
return getJdbcTypeCount(); return getJdbcTypeCount();
} }
@ -303,12 +305,14 @@ public class AnyKeyPart implements BasicValuedModelPart, FetchOptions {
} }
@Override @Override
public int forEachDisassembledJdbcValue( public <X, Y> int forEachDisassembledJdbcValue(
Object value, Object value,
int offset, int offset,
JdbcValuesConsumer valuesConsumer, X x,
Y y,
JdbcValuesBiConsumer<X, Y> valuesConsumer,
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
valuesConsumer.consume( offset, value, jdbcMapping ); valuesConsumer.consume( offset, x, y, value, jdbcMapping );
return 1; return 1;
} }

View File

@ -399,12 +399,14 @@ public class BasicAttributeMapping
} }
@Override @Override
public int forEachDisassembledJdbcValue( public <X, Y> int forEachDisassembledJdbcValue(
Object value, Object value,
int offset, int offset,
JdbcValuesConsumer valuesConsumer, X x,
Y y,
JdbcValuesBiConsumer<X, Y> valuesConsumer,
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
valuesConsumer.consume( offset, value, getJdbcMapping() ); valuesConsumer.consume( offset, x, y, value, getJdbcMapping() );
return getJdbcTypeCount(); return getJdbcTypeCount();
} }

View File

@ -376,12 +376,14 @@ public class BasicEntityIdentifierMappingImpl implements BasicEntityIdentifierMa
} }
@Override @Override
public int forEachDisassembledJdbcValue( public <X, Y> int forEachDisassembledJdbcValue(
Object value, Object value,
int offset, int offset,
JdbcValuesConsumer valuesConsumer, X x,
Y y,
JdbcValuesBiConsumer<X, Y> valuesConsumer,
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
return idType.forEachDisassembledJdbcValue( value, offset, valuesConsumer, session ); return idType.forEachDisassembledJdbcValue( value, offset, x, y, valuesConsumer, session );
} }
@Override @Override

View File

@ -334,12 +334,14 @@ public class BasicValuedCollectionPart
} }
@Override @Override
public int forEachDisassembledJdbcValue( public <X, Y> int forEachDisassembledJdbcValue(
Object value, Object value,
int offset, int offset,
JdbcValuesConsumer valuesConsumer, X x,
Y y,
JdbcValuesBiConsumer<X, Y> valuesConsumer,
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
valuesConsumer.consume( offset, value, getJdbcMapping() ); valuesConsumer.consume( offset, x, y, value, getJdbcMapping() );
return getJdbcTypeCount(); return getJdbcTypeCount();
} }

View File

@ -317,11 +317,13 @@ public class CollectionIdentifierDescriptorImpl implements CollectionIdentifierD
} }
@Override @Override
public int forEachDisassembledJdbcValue( public <X, Y> int forEachDisassembledJdbcValue(
Object value, Object value,
int offset, int offset,
JdbcValuesConsumer valuesConsumer, X x,
Y y,
JdbcValuesBiConsumer<X, Y> valuesConsumer,
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
return type.forEachDisassembledJdbcValue( value, offset, valuesConsumer, session ); return type.forEachDisassembledJdbcValue( value, offset, x, y, valuesConsumer, session );
} }
} }

View File

@ -386,10 +386,12 @@ public class CompoundNaturalIdMapping extends AbstractNaturalIdMapping implement
} }
@Override @Override
public int forEachDisassembledJdbcValue( public <X, Y> int forEachDisassembledJdbcValue(
Object value, Object value,
int offset, int offset,
JdbcValuesConsumer valuesConsumer, X x,
Y y,
JdbcValuesBiConsumer<X, Y> valuesConsumer,
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
assert value instanceof Object[]; assert value instanceof Object[];
@ -398,16 +400,18 @@ public class CompoundNaturalIdMapping extends AbstractNaturalIdMapping implement
int span = 0; int span = 0;
for ( int i = 0; i < attributes.size(); i++ ) { for ( int i = 0; i < attributes.size(); i++ ) {
final SingularAttributeMapping attribute = attributes.get( i ); final SingularAttributeMapping attribute = attributes.get( i );
span += attribute.forEachDisassembledJdbcValue( incoming[ i ], span + offset, valuesConsumer, session ); span += attribute.forEachDisassembledJdbcValue( incoming[ i ], span + offset, x, y, valuesConsumer, session );
} }
return span; return span;
} }
@Override @Override
public int forEachJdbcValue( public <X, Y> int forEachJdbcValue(
Object value, Object value,
int offset, int offset,
JdbcValuesConsumer valuesConsumer, X x,
Y y,
JdbcValuesBiConsumer<X, Y> valuesConsumer,
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
assert value instanceof Object[]; assert value instanceof Object[];
@ -417,7 +421,7 @@ public class CompoundNaturalIdMapping extends AbstractNaturalIdMapping implement
int span = 0; int span = 0;
for ( int i = 0; i < attributes.size(); i++ ) { for ( int i = 0; i < attributes.size(); i++ ) {
final SingularAttributeMapping attribute = attributes.get( i ); final SingularAttributeMapping attribute = attributes.get( i );
span += attribute.forEachJdbcValue( incoming[ i ], span + offset, valuesConsumer, session ); span += attribute.forEachJdbcValue( incoming[ i ], span + offset, x, y, valuesConsumer, session );
} }
return span; return span;
} }

View File

@ -266,21 +266,27 @@ public class DiscriminatedAssociationAttributeMapping
} }
@Override @Override
public int forEachDisassembledJdbcValue( public <X, Y> int forEachDisassembledJdbcValue(
Object value, Object value,
int offset, int offset,
JdbcValuesConsumer valuesConsumer, X x,
Y y,
JdbcValuesBiConsumer<X, Y> valuesConsumer,
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
if ( value != null ) { if ( value != null ) {
if ( value.getClass().isArray() ) { if ( value.getClass().isArray() ) {
final Object[] values = (Object[]) value; final Object[] values = (Object[]) value;
valuesConsumer.consume( valuesConsumer.consume(
offset, offset,
x,
y,
values[0], values[0],
discriminatorMapping.getDiscriminatorPart().getJdbcMapping() discriminatorMapping.getDiscriminatorPart().getJdbcMapping()
); );
valuesConsumer.consume( valuesConsumer.consume(
offset + 1, offset + 1,
x,
y,
values[1], values[1],
discriminatorMapping.getKeyPart().getJdbcMapping() discriminatorMapping.getKeyPart().getJdbcMapping()
); );
@ -294,6 +300,8 @@ public class DiscriminatedAssociationAttributeMapping
final Object disassembledDiscriminator = discriminatorMapping.getDiscriminatorPart().disassemble( discriminator, session ); final Object disassembledDiscriminator = discriminatorMapping.getDiscriminatorPart().disassemble( discriminator, session );
valuesConsumer.consume( valuesConsumer.consume(
offset, offset,
x,
y,
disassembledDiscriminator, disassembledDiscriminator,
discriminatorMapping.getDiscriminatorPart().getJdbcMapping() discriminatorMapping.getDiscriminatorPart().getJdbcMapping()
); );
@ -303,6 +311,8 @@ public class DiscriminatedAssociationAttributeMapping
final Object disassembledKey = discriminatorMapping.getKeyPart().disassemble( identifier, session ); final Object disassembledKey = discriminatorMapping.getKeyPart().disassemble( identifier, session );
valuesConsumer.consume( valuesConsumer.consume(
offset + 1, offset + 1,
x,
y,
disassembledKey, disassembledKey,
discriminatorMapping.getKeyPart().getJdbcMapping() discriminatorMapping.getKeyPart().getJdbcMapping()
); );

View File

@ -267,14 +267,18 @@ public class DiscriminatedCollectionPart implements DiscriminatedAssociationMode
} }
@Override @Override
public int forEachDisassembledJdbcValue( public <X, Y> int forEachDisassembledJdbcValue(
Object value, Object value,
int offset, int offset,
JdbcValuesConsumer valuesConsumer, X x,
Y y,
JdbcValuesBiConsumer<X, Y> valuesConsumer,
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
return discriminatorMapping.getDiscriminatorPart().forEachDisassembledJdbcValue( return discriminatorMapping.getDiscriminatorPart().forEachDisassembledJdbcValue(
value, value,
offset, offset,
x,
y,
valuesConsumer, valuesConsumer,
session session
); );

View File

@ -760,10 +760,12 @@ public class EmbeddableMappingTypeImpl extends AbstractEmbeddableMapping impleme
} }
@Override @Override
public int forEachJdbcValue( public <X, Y> int forEachJdbcValue(
Object value, Object value,
int offset, int offset,
JdbcValuesConsumer consumer, X x,
Y y,
JdbcValuesBiConsumer<X, Y> consumer,
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
int span = 0; int span = 0;
@ -773,22 +775,24 @@ public class EmbeddableMappingTypeImpl extends AbstractEmbeddableMapping impleme
continue; continue;
} }
final Object o = attributeMapping.getPropertyAccess().getGetter().get( value ); final Object o = attributeMapping.getPropertyAccess().getGetter().get( value );
span += attributeMapping.forEachJdbcValue( o, span + offset, consumer, session ); span += attributeMapping.forEachJdbcValue( o, span + offset, x, y, consumer, session );
} }
return span; return span;
} }
@Override @Override
public int forEachDisassembledJdbcValue( public <X, Y> int forEachDisassembledJdbcValue(
Object value, Object value,
int offset, int offset,
JdbcValuesConsumer valuesConsumer, X x,
Y y,
JdbcValuesBiConsumer<X, Y> valuesConsumer,
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
final Object[] values = (Object[]) value; final Object[] values = (Object[]) value;
int span = 0; int span = 0;
for ( int i = 0; i < attributeMappings.size(); i++ ) { for ( int i = 0; i < attributeMappings.size(); i++ ) {
final AttributeMapping mapping = attributeMappings.get( i ); final AttributeMapping mapping = attributeMappings.get( i );
span += mapping.forEachDisassembledJdbcValue( values[i], span + offset, valuesConsumer, session ); span += mapping.forEachDisassembledJdbcValue( values[i], span + offset, x, y, valuesConsumer, session );
} }
return span; return span;
} }

View File

@ -586,12 +586,14 @@ public class EmbeddedForeignKeyDescriptor implements ForeignKeyDescriptor {
} }
@Override @Override
public int forEachDisassembledJdbcValue( public <X, Y> int forEachDisassembledJdbcValue(
Object value, Object value,
int offset, int offset,
JdbcValuesConsumer valuesConsumer, X x,
Y y,
JdbcValuesBiConsumer<X, Y> valuesConsumer,
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
return targetSide.getModelPart().forEachDisassembledJdbcValue( value, offset, valuesConsumer, session ); return targetSide.getModelPart().forEachDisassembledJdbcValue( value, offset, x, y, valuesConsumer, session );
} }
@Override @Override

View File

@ -136,14 +136,18 @@ public class EmbeddedIdentifierMappingImpl
} }
@Override @Override
public int forEachDisassembledJdbcValue( public <X, Y> int forEachDisassembledJdbcValue(
Object value, Object value,
int offset, int offset,
JdbcValuesConsumer valuesConsumer, X x,
Y y,
JdbcValuesBiConsumer<X, Y> valuesConsumer,
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
return getEmbeddableTypeDescriptor().forEachDisassembledJdbcValue( return getEmbeddableTypeDescriptor().forEachDisassembledJdbcValue(
value, value,
offset, offset,
x,
y,
valuesConsumer, valuesConsumer,
session session
); );

View File

@ -124,12 +124,14 @@ public class EntityRowIdMappingImpl implements EntityRowIdMapping {
} }
@Override @Override
public int forEachDisassembledJdbcValue( public <X, Y> int forEachDisassembledJdbcValue(
Object value, Object value,
int offset, int offset,
JdbcValuesConsumer valuesConsumer, X x,
Y y,
JdbcValuesBiConsumer<X, Y> valuesConsumer,
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
return rowIdType.forEachDisassembledJdbcValue( value, offset, valuesConsumer, session ); return rowIdType.forEachDisassembledJdbcValue( value, offset, x, y, valuesConsumer, session );
} }
@Override @Override

View File

@ -328,12 +328,14 @@ public class EntityVersionMappingImpl implements EntityVersionMapping, FetchOpti
} }
@Override @Override
public int forEachDisassembledJdbcValue( public <X, Y> int forEachDisassembledJdbcValue(
Object value, Object value,
int offset, int offset,
JdbcValuesConsumer valuesConsumer, X x,
Y y,
JdbcValuesBiConsumer<X, Y> valuesConsumer,
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
return versionBasicType.forEachDisassembledJdbcValue( value, offset, valuesConsumer, session ); return versionBasicType.forEachDisassembledJdbcValue( value, offset, x, y, valuesConsumer, session );
} }
@Override @Override

View File

@ -405,10 +405,12 @@ public class IdClassEmbeddable extends AbstractEmbeddableMapping implements Iden
} }
@Override @Override
public int forEachJdbcValue( public <X, Y> int forEachJdbcValue(
Object value, Object value,
int offset, int offset,
JdbcValuesConsumer valuesConsumer, X x,
Y y,
JdbcValuesBiConsumer<X, Y> valuesConsumer,
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
int span = 0; int span = 0;
@ -418,7 +420,7 @@ public class IdClassEmbeddable extends AbstractEmbeddableMapping implements Iden
continue; continue;
} }
final Object o = attributeMapping.getPropertyAccess().getGetter().get( value ); final Object o = attributeMapping.getPropertyAccess().getGetter().get( value );
span += attributeMapping.forEachJdbcValue( o, span + offset, valuesConsumer, session ); span += attributeMapping.forEachJdbcValue( o, span + offset, x, y, valuesConsumer, session );
} }
return span; return span;
} }
@ -437,10 +439,12 @@ public class IdClassEmbeddable extends AbstractEmbeddableMapping implements Iden
} }
@Override @Override
public int forEachDisassembledJdbcValue( public <X, Y> int forEachDisassembledJdbcValue(
Object value, Object value,
int offset, int offset,
JdbcValuesConsumer valuesConsumer, X x,
Y y,
JdbcValuesBiConsumer<X, Y> valuesConsumer,
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }

View File

@ -134,12 +134,14 @@ public class InverseNonAggregatedIdentifierMapping extends EmbeddedAttributeMapp
} }
@Override @Override
public int forEachJdbcValue( public <X, Y> int forEachJdbcValue(
Object value, Object value,
int offset, int offset,
JdbcValuesConsumer valuesConsumer, X x,
Y y,
JdbcValuesBiConsumer<X, Y> valuesConsumer,
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
return identifierValueMapper.forEachJdbcValue( value, offset, valuesConsumer, session ); return identifierValueMapper.forEachJdbcValue( value, offset, x, y, valuesConsumer, session );
} }
@Override @Override

View File

@ -148,12 +148,12 @@ public class NonAggregatedIdentifierMappingImpl extends AbstractCompositeIdentif
} }
@Override @Override
public int forEachJdbcValue( public <X, Y> int forEachJdbcValue(
Object value, Object value,
int offset, int offset,
JdbcValuesConsumer valuesConsumer, X x, Y y, JdbcValuesBiConsumer<X, Y> valuesConsumer,
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
return identifierValueMapper.forEachJdbcValue( value, offset, valuesConsumer, session ); return identifierValueMapper.forEachJdbcValue( value, offset, x, y, valuesConsumer, session );
} }
@Override @Override

View File

@ -950,12 +950,14 @@ public class PluralAttributeMappingImpl
} }
@Override @Override
public int forEachDisassembledJdbcValue( public <X, Y> int forEachDisassembledJdbcValue(
Object value, Object value,
int offset, int offset,
JdbcValuesConsumer valuesConsumer, X x,
Y y,
JdbcValuesBiConsumer<X, Y> valuesConsumer,
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
return elementDescriptor.forEachDisassembledJdbcValue( value, offset, valuesConsumer, session ); return elementDescriptor.forEachDisassembledJdbcValue( value, offset, x, y, valuesConsumer, session );
} }
@Override @Override

View File

@ -454,12 +454,14 @@ public class SimpleForeignKeyDescriptor implements ForeignKeyDescriptor, BasicVa
} }
@Override @Override
public int forEachDisassembledJdbcValue( public <X, Y> int forEachDisassembledJdbcValue(
Object value, Object value,
int offset, int offset,
JdbcValuesConsumer valuesConsumer, X x,
Y y,
JdbcValuesBiConsumer<X, Y> valuesConsumer,
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
valuesConsumer.consume( offset, value, getJdbcMapping() ); valuesConsumer.consume( offset, x, y, value, getJdbcMapping() );
return 1; return 1;
} }
@ -519,12 +521,14 @@ public class SimpleForeignKeyDescriptor implements ForeignKeyDescriptor, BasicVa
} }
@Override @Override
public int forEachJdbcValue( public <X, Y> int forEachJdbcValue(
Object value, Object value,
int offset, int offset,
JdbcValuesConsumer valuesConsumer, X x,
Y y,
JdbcValuesBiConsumer<X, Y> valuesConsumer,
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
valuesConsumer.consume( offset, disassemble( value, session ), targetSide.getModelPart().getJdbcMapping() ); valuesConsumer.consume( offset, x, y, disassemble( value, session ), targetSide.getModelPart().getJdbcMapping() );
return getJdbcTypeCount(); return getJdbcTypeCount();
} }

View File

@ -248,21 +248,25 @@ public class SimpleNaturalIdMapping extends AbstractNaturalIdMapping implements
} }
@Override @Override
public int forEachDisassembledJdbcValue( public <X, Y> int forEachDisassembledJdbcValue(
Object value, Object value,
int offset, int offset,
JdbcValuesConsumer valuesConsumer, X x,
Y y,
JdbcValuesBiConsumer<X, Y> valuesConsumer,
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
return attribute.forEachDisassembledJdbcValue( value, offset, valuesConsumer, session ); return attribute.forEachDisassembledJdbcValue( value, offset, x, y, valuesConsumer, session );
} }
@Override @Override
public int forEachJdbcValue( public <X, Y> int forEachJdbcValue(
Object value, Object value,
int offset, int offset,
JdbcValuesConsumer valuesConsumer, X x,
Y y,
JdbcValuesBiConsumer<X, Y> valuesConsumer,
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
return attribute.forEachJdbcValue( value, offset, valuesConsumer, session ); return attribute.forEachJdbcValue( value, offset, x, y, valuesConsumer, session );
} }
@Override @Override

View File

@ -2148,19 +2148,23 @@ public class ToOneAttributeMapping
} }
@Override @Override
public int forEachDisassembledJdbcValue( public <X, Y> int forEachDisassembledJdbcValue(
Object value, Object value,
int offset, int offset,
JdbcValuesConsumer valuesConsumer, X x,
Y y,
JdbcValuesBiConsumer<X, Y> valuesConsumer,
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
return foreignKeyDescriptor.forEachDisassembledJdbcValue( value, offset, valuesConsumer, session ); return foreignKeyDescriptor.forEachDisassembledJdbcValue( value, offset, x, y, valuesConsumer, session );
} }
@Override @Override
public int forEachJdbcValue( public <X, Y> int forEachJdbcValue(
Object value, Object value,
int offset, int offset,
JdbcValuesConsumer consumer, X x,
Y y,
JdbcValuesBiConsumer<X, Y> consumer,
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
return foreignKeyDescriptor.forEachDisassembledJdbcValue( return foreignKeyDescriptor.forEachDisassembledJdbcValue(
foreignKeyDescriptor.disassemble( foreignKeyDescriptor.disassemble(
@ -2168,6 +2172,8 @@ public class ToOneAttributeMapping
session session
), ),
offset, offset,
x,
y,
consumer, consumer,
session session
); );

View File

@ -298,10 +298,12 @@ public class VirtualIdEmbeddable extends AbstractEmbeddableMapping implements Id
} }
@Override @Override
public int forEachJdbcValue( public <X, Y> int forEachJdbcValue(
Object value, Object value,
int offset, int offset,
JdbcValuesConsumer valuesConsumer, X x,
Y y,
JdbcValuesBiConsumer<X, Y> valuesConsumer,
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
int span = 0; int span = 0;
@ -311,7 +313,7 @@ public class VirtualIdEmbeddable extends AbstractEmbeddableMapping implements Id
continue; continue;
} }
final Object o = attributeMapping.getPropertyAccess().getGetter().get( value ); final Object o = attributeMapping.getPropertyAccess().getGetter().get( value );
span += attributeMapping.forEachJdbcValue( o, span + offset, valuesConsumer, session ); span += attributeMapping.forEachJdbcValue( o, span + offset, x, y, valuesConsumer, session );
} }
return span; return span;
} }
@ -356,16 +358,18 @@ public class VirtualIdEmbeddable extends AbstractEmbeddableMapping implements Id
} }
@Override @Override
public int forEachDisassembledJdbcValue( public <X, Y> int forEachDisassembledJdbcValue(
Object value, Object value,
int offset, int offset,
JdbcValuesConsumer valuesConsumer, X x,
Y y,
JdbcValuesBiConsumer<X, Y> valuesConsumer,
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
final Object[] values = (Object[]) value; final Object[] values = (Object[]) value;
int span = 0; int span = 0;
for ( int i = 0; i < attributeMappings.size(); i++ ) { for ( int i = 0; i < attributeMappings.size(); i++ ) {
final AttributeMapping mapping = attributeMappings.get( i ); final AttributeMapping mapping = attributeMappings.get( i );
span += mapping.forEachDisassembledJdbcValue( values[i], span + offset, valuesConsumer, session ); span += mapping.forEachDisassembledJdbcValue( values[i], span + offset, x, y, valuesConsumer, session );
} }
return span; return span;
} }

View File

@ -94,10 +94,12 @@ public class ArrayTupleType implements TupleType<Object[]>,
} }
@Override @Override
public int forEachDisassembledJdbcValue( public <X, Y> int forEachDisassembledJdbcValue(
Object value, Object value,
int offset, int offset,
JdbcValuesConsumer valuesConsumer, X x,
Y y,
JdbcValuesBiConsumer<X, Y> valuesConsumer,
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }

View File

@ -42,24 +42,28 @@ public class TupleMappingModelExpressible implements MappingModelExpressible {
} }
@Override @Override
public int forEachDisassembledJdbcValue( public <X, Y> int forEachDisassembledJdbcValue(
Object value, Object value,
int offset, int offset,
JdbcValuesConsumer valuesConsumer, X x,
Y y,
JdbcValuesBiConsumer<X, Y> valuesConsumer,
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
final Object[] values = (Object[]) value; final Object[] values = (Object[]) value;
int span = 0; int span = 0;
for ( int i = 0; i < components.length; i++ ) { for ( int i = 0; i < components.length; i++ ) {
span += components[i].forEachDisassembledJdbcValue( values[i], span + offset, valuesConsumer, session ); span += components[i].forEachDisassembledJdbcValue( values[i], span + offset, x, y, valuesConsumer, session );
} }
return span; return span;
} }
@Override @Override
public int forEachJdbcValue( public <X, Y> int forEachJdbcValue(
Object value, Object value,
int offset, int offset,
JdbcValuesConsumer valuesConsumer, X x,
Y y,
JdbcValuesBiConsumer<X, Y> valuesConsumer,
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
final Object[] values = (Object[]) value; final Object[] values = (Object[]) value;
int span = 0; int span = 0;
@ -67,7 +71,7 @@ public class TupleMappingModelExpressible implements MappingModelExpressible {
span += components[i].forEachDisassembledJdbcValue( span += components[i].forEachDisassembledJdbcValue(
components[i].disassemble( values[i], session ), components[i].disassemble( values[i], session ),
span + offset, span + offset,
valuesConsumer, x, y, valuesConsumer,
session session
); );
} }

View File

@ -5840,25 +5840,29 @@ public abstract class AbstractEntityPersister
} }
@Override @Override
public int forEachDisassembledJdbcValue( public <X, Y> int forEachDisassembledJdbcValue(
Object value, Object value,
int offset, int offset,
JdbcValuesConsumer valuesConsumer, X x,
Y y,
JdbcValuesBiConsumer<X, Y> valuesConsumer,
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
return getIdentifierMapping() return getIdentifierMapping()
.forEachDisassembledJdbcValue( value, offset, valuesConsumer, session ); .forEachDisassembledJdbcValue( value, offset, x, y, valuesConsumer, session );
} }
@Override @Override
public int forEachJdbcValue( public <X, Y> int forEachJdbcValue(
Object value, Object value,
int offset, int offset,
JdbcValuesConsumer consumer, X x,
Y y,
JdbcValuesBiConsumer<X, Y> consumer,
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
final EntityIdentifierMapping identifierMapping = getIdentifierMapping(); final EntityIdentifierMapping identifierMapping = getIdentifierMapping();
final Object identifier = value == null ? null final Object identifier = value == null ? null
: identifierMapping.disassemble( identifierMapping.getIdentifier( value ), session ); : identifierMapping.disassemble( identifierMapping.getIdentifier( value ), session );
return identifierMapping.forEachDisassembledJdbcValue( identifier, offset, consumer, session ); return identifierMapping.forEachDisassembledJdbcValue( identifier, offset, x, y, consumer, session );
} }
@Override @Override

View File

@ -229,9 +229,11 @@ public class EntityTableMapping implements TableMapping {
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
identifierPart.forEachJdbcValue( identifierPart.forEachJdbcValue(
domainValue, domainValue,
(selectionIndex, jdbcValue, jdbcMapping) -> valueConsumer.consume( keyColumns,
valueConsumer,
(selectionIndex, keys, consumer, jdbcValue, jdbcMapping) -> consumer.consume(
jdbcValue, jdbcValue,
keyColumns.get( selectionIndex ) keys.get( selectionIndex )
), ),
session session
); );

View File

@ -280,12 +280,14 @@ public class AnonymousTupleBasicValuedModelPart implements ModelPart, MappingTyp
} }
@Override @Override
public int forEachDisassembledJdbcValue( public <X, Y> int forEachDisassembledJdbcValue(
Object value, Object value,
int offset, int offset,
JdbcValuesConsumer valuesConsumer, X x,
Y y,
JdbcValuesBiConsumer<X, Y> valuesConsumer,
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
valuesConsumer.consume( offset, value, getJdbcMapping() ); valuesConsumer.consume( offset, x, y, value, getJdbcMapping() );
return getJdbcTypeCount(); return getJdbcTypeCount();
} }
@ -306,12 +308,14 @@ public class AnonymousTupleBasicValuedModelPart implements ModelPart, MappingTyp
} }
@Override @Override
public int forEachJdbcValue( public <X, Y> int forEachJdbcValue(
Object value, Object value,
int offset, int offset,
JdbcValuesConsumer valuesConsumer, X x,
Y y,
JdbcValuesBiConsumer<X, Y> valuesConsumer,
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
valuesConsumer.consume( offset, value, getJdbcMapping() ); valuesConsumer.consume( offset, x, y, value, getJdbcMapping() );
return getJdbcTypeCount(); return getJdbcTypeCount();
} }

View File

@ -431,33 +431,37 @@ public class AnonymousTupleEmbeddableValuedModelPart implements EmbeddableValued
} }
@Override @Override
public int forEachDisassembledJdbcValue( public <X, Y> int forEachDisassembledJdbcValue(
Object value, Object value,
int offset, int offset,
JdbcValuesConsumer valuesConsumer, X x,
Y y,
JdbcValuesBiConsumer<X, Y> valuesConsumer,
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
final Object[] values = (Object[]) value; final Object[] values = (Object[]) value;
int span = 0; int span = 0;
int i = 0; int i = 0;
for ( ModelPart mapping : modelParts.values() ) { for ( ModelPart mapping : modelParts.values() ) {
span += mapping.forEachDisassembledJdbcValue( values[i], span + offset, valuesConsumer, session ); span += mapping.forEachDisassembledJdbcValue( values[i], span + offset, x, y, valuesConsumer, session );
i++; i++;
} }
return span; return span;
} }
@Override @Override
public int forEachJdbcValue( public <X, Y> int forEachJdbcValue(
Object value, Object value,
int offset, int offset,
JdbcValuesConsumer consumer, X x,
Y y,
JdbcValuesBiConsumer<X, Y> consumer,
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
final Object[] values = (Object[]) value; final Object[] values = (Object[]) value;
int span = 0; int span = 0;
int i = 0; int i = 0;
for ( ModelPart attributeMapping : modelParts.values() ) { for ( ModelPart attributeMapping : modelParts.values() ) {
final Object o = values[i]; final Object o = values[i];
span += attributeMapping.forEachJdbcValue( o, span + offset, consumer, session ); span += attributeMapping.forEachJdbcValue( o, span + offset, x, y, consumer, session );
i++; i++;
} }
return span; return span;

View File

@ -563,21 +563,25 @@ public class AnonymousTupleEntityValuedModelPart
} }
@Override @Override
public int forEachDisassembledJdbcValue( public <X, Y> int forEachDisassembledJdbcValue(
Object value, Object value,
int offset, int offset,
JdbcValuesConsumer valuesConsumer, X x,
Y y,
JdbcValuesBiConsumer<X, Y> valuesConsumer,
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
return delegate.forEachDisassembledJdbcValue( value, offset, valuesConsumer, session ); return delegate.forEachDisassembledJdbcValue( value, offset, x, y, valuesConsumer, session );
} }
@Override @Override
public int forEachJdbcValue( public <X, Y> int forEachJdbcValue(
Object value, Object value,
int offset, int offset,
JdbcValuesConsumer consumer, X x,
Y y,
JdbcValuesBiConsumer<X, Y> consumer,
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
return delegate.forEachJdbcValue( value, offset, consumer, session ); return delegate.forEachJdbcValue( value, offset, x, y, consumer, session );
} }
@Override @Override

View File

@ -42,8 +42,6 @@ import org.hibernate.query.sqm.tree.select.SqmSelectableNode;
import org.hibernate.spi.NavigablePath; import org.hibernate.spi.NavigablePath;
import org.hibernate.sql.ast.spi.FromClauseAccess; import org.hibernate.sql.ast.spi.FromClauseAccess;
import org.hibernate.sql.ast.spi.SqlSelection; import org.hibernate.sql.ast.spi.SqlSelection;
import org.hibernate.sql.ast.tree.expression.Expression;
import org.hibernate.sql.ast.tree.expression.SqlTuple;
import org.hibernate.sql.ast.tree.from.LazyTableGroup; import org.hibernate.sql.ast.tree.from.LazyTableGroup;
import org.hibernate.sql.ast.tree.from.PluralTableGroup; import org.hibernate.sql.ast.tree.from.PluralTableGroup;
import org.hibernate.sql.ast.tree.from.TableGroup; import org.hibernate.sql.ast.tree.from.TableGroup;
@ -389,10 +387,12 @@ public class AnonymousTupleTableGroupProducer implements TableGroupProducer, Map
} }
@Override @Override
public int forEachDisassembledJdbcValue( public <X, Y> int forEachDisassembledJdbcValue(
Object value, Object value,
int offset, int offset,
JdbcValuesConsumer valuesConsumer, X x,
Y y,
JdbcValuesBiConsumer<X, Y> valuesConsumer,
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
throw new UnsupportedOperationException( "Not yet implemented" ); throw new UnsupportedOperationException( "Not yet implemented" );
} }

View File

@ -272,7 +272,6 @@ import org.hibernate.query.sqm.tree.select.SqmSubQuery;
import org.hibernate.query.sqm.tree.update.SqmAssignment; import org.hibernate.query.sqm.tree.update.SqmAssignment;
import org.hibernate.query.sqm.tree.update.SqmSetClause; import org.hibernate.query.sqm.tree.update.SqmSetClause;
import org.hibernate.query.sqm.tree.update.SqmUpdateStatement; import org.hibernate.query.sqm.tree.update.SqmUpdateStatement;
import org.hibernate.spi.EntityIdentifierNavigablePath;
import org.hibernate.spi.NavigablePath; import org.hibernate.spi.NavigablePath;
import org.hibernate.sql.ast.Clause; import org.hibernate.sql.ast.Clause;
import org.hibernate.sql.ast.SqlAstJoinType; import org.hibernate.sql.ast.SqlAstJoinType;
@ -5063,8 +5062,10 @@ public abstract class BaseSqmToSqlAstConverter<T extends Statement> extends Base
final List<Expression> list = new ArrayList<>( embeddableValuedModelPart.getJdbcTypeCount() ); final List<Expression> list = new ArrayList<>( embeddableValuedModelPart.getJdbcTypeCount() );
embeddableValuedModelPart.forEachJdbcValue( embeddableValuedModelPart.forEachJdbcValue(
literal.getLiteralValue(), literal.getLiteralValue(),
(selectionIndex, value, jdbcMapping) list,
-> list.add( new QueryLiteral<>( value, (BasicValuedMapping) jdbcMapping ) ), null,
(selectionIndex, expressions, noop, value, jdbcMapping)
-> expressions.add( new QueryLiteral<>( value, (BasicValuedMapping) jdbcMapping ) ),
null null
); );
return new SqlTuple( list, expressible ); return new SqlTuple( list, expressible );
@ -5107,8 +5108,10 @@ public abstract class BaseSqmToSqlAstConverter<T extends Statement> extends Base
final List<Expression> list = new ArrayList<>( associationKeyPart.getJdbcTypeCount() ); final List<Expression> list = new ArrayList<>( associationKeyPart.getJdbcTypeCount() );
associationKeyPart.forEachJdbcValue( associationKeyPart.forEachJdbcValue(
associationKey, associationKey,
(selectionIndex, value, jdbcMapping) list,
-> list.add( new QueryLiteral<>( value, (BasicValuedMapping) jdbcMapping ) ), null,
(selectionIndex, expressions, noop, value, jdbcMapping)
-> expressions.add( new QueryLiteral<>( value, (BasicValuedMapping) jdbcMapping ) ),
null null
); );
return new SqlTuple( list, associationKeyPart ); return new SqlTuple( list, associationKeyPart );

View File

@ -80,21 +80,25 @@ public class EntityTypeLiteral
} }
@Override @Override
public int forEachDisassembledJdbcValue( public <X, Y> int forEachDisassembledJdbcValue(
Object value, Object value,
int offset, int offset,
JdbcValuesConsumer valuesConsumer, X x,
Y y,
JdbcValuesBiConsumer<X, Y> valuesConsumer,
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
return discriminatorType.forEachDisassembledJdbcValue( value, offset, valuesConsumer, session ); return discriminatorType.forEachDisassembledJdbcValue( value, offset, x, y, valuesConsumer, session );
} }
@Override @Override
public int forEachJdbcValue( public <X, Y> int forEachJdbcValue(
Object value, Object value,
int offset, int offset,
JdbcValuesConsumer valuesConsumer, X x,
Y y,
JdbcValuesBiConsumer<X, Y> valuesConsumer,
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
return discriminatorType.forEachJdbcValue( value, offset, valuesConsumer, session ); return discriminatorType.forEachJdbcValue( value, offset, x, y, valuesConsumer, session );
} }

View File

@ -119,22 +119,26 @@ public class JdbcLiteral<T> implements Literal, MappingModelExpressible<T>, Doma
} }
@Override @Override
public int forEachDisassembledJdbcValue( public <X, Y> int forEachDisassembledJdbcValue(
Object value, Object value,
int offset, int offset,
JdbcValuesConsumer valuesConsumer, X x,
Y y,
JdbcValuesBiConsumer<X, Y> valuesConsumer,
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
valuesConsumer.consume( offset, value, jdbcMapping ); valuesConsumer.consume( offset, x, y, value, jdbcMapping );
return getJdbcTypeCount(); return getJdbcTypeCount();
} }
@Override @Override
public int forEachJdbcValue( public <X, Y> int forEachJdbcValue(
Object value, Object value,
int offset, int offset,
JdbcValuesConsumer valuesConsumer, X x,
Y y,
JdbcValuesBiConsumer<X, Y> valuesConsumer,
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
valuesConsumer.consume( offset, value, jdbcMapping ); valuesConsumer.consume( offset, x, y, value, jdbcMapping );
return getJdbcTypeCount(); return getJdbcTypeCount();
} }

View File

@ -155,22 +155,26 @@ public abstract class AbstractJdbcParameter
} }
@Override @Override
public int forEachDisassembledJdbcValue( public <X, Y> int forEachDisassembledJdbcValue(
Object value, Object value,
int offset, int offset,
JdbcValuesConsumer valuesConsumer, X x,
Y y,
JdbcValuesBiConsumer<X, Y> valuesConsumer,
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
valuesConsumer.consume( offset, value, jdbcMapping ); valuesConsumer.consume( offset, x, y, value, jdbcMapping );
return getJdbcTypeCount(); return getJdbcTypeCount();
} }
@Override @Override
public int forEachJdbcValue( public <X, Y> int forEachJdbcValue(
Object value, Object value,
int offset, int offset,
JdbcValuesConsumer valuesConsumer, X x,
Y y,
JdbcValuesBiConsumer<X, Y> valuesConsumer,
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
valuesConsumer.consume( offset, value, jdbcMapping ); valuesConsumer.consume( offset, x, y, value, jdbcMapping );
return getJdbcTypeCount(); return getJdbcTypeCount();
} }
} }

View File

@ -88,14 +88,16 @@ public interface JdbcParameterBindings {
return bindable.forEachJdbcValue( return bindable.forEachJdbcValue(
value, value,
offset, offset,
(selectionIndex, jdbcValue, type) -> { jdbcParameters,
session.getFactory().getTypeConfiguration(),
(selectionIndex, params, typeConfiguration, jdbcValue, type) -> {
addBinding( addBinding(
jdbcParameters.get( selectionIndex ), params.get( selectionIndex ),
new JdbcParameterBindingImpl( new JdbcParameterBindingImpl(
BindingTypeHelper.INSTANCE.resolveBindType( BindingTypeHelper.INSTANCE.resolveBindType(
jdbcValue, jdbcValue,
type, type,
session.getFactory().getTypeConfiguration() typeConfiguration
), ),
jdbcValue jdbcValue
) )

View File

@ -123,12 +123,14 @@ public interface BasicType<T> extends Type, BasicDomainType<T>, MappingType, Bas
} }
@Override @Override
default int forEachDisassembledJdbcValue( default <X, Y> int forEachDisassembledJdbcValue(
Object value, Object value,
int offset, int offset,
JdbcValuesConsumer valuesConsumer, X x,
Y y,
JdbcValuesBiConsumer<X, Y> valuesConsumer,
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
valuesConsumer.consume( offset, value, getJdbcMapping() ); valuesConsumer.consume( offset, x, y, value, getJdbcMapping() );
return getJdbcTypeCount(); return getJdbcTypeCount();
} }

View File

@ -193,10 +193,12 @@ public class GoofyPersisterClassProvider implements PersisterClassResolver {
} }
@Override @Override
public int forEachDisassembledJdbcValue( public <X, Y> int forEachDisassembledJdbcValue(
Object value, Object value,
int offset, int offset,
JdbcValuesConsumer valuesConsumer, X x,
Y y,
JdbcValuesBiConsumer<X, Y> valuesConsumer,
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
return 0; return 0;
} }

View File

@ -220,10 +220,12 @@ public class PersisterClassProviderTest {
} }
@Override @Override
public int forEachDisassembledJdbcValue( public <X, Y> int forEachDisassembledJdbcValue(
Object value, Object value,
int offset, int offset,
JdbcValuesConsumer valuesConsumer, X x,
Y y,
JdbcValuesBiConsumer<X, Y> valuesConsumer,
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
return 0; return 0;
} }

View File

@ -181,10 +181,12 @@ public class CustomPersister implements EntityPersister {
} }
@Override @Override
public int forEachDisassembledJdbcValue( public <X, Y> int forEachDisassembledJdbcValue(
Object value, Object value,
int offset, int offset,
JdbcValuesConsumer valuesConsumer, X x,
Y y,
JdbcValuesBiConsumer<X, Y> valuesConsumer,
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
return 0; return 0;
} }