diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/SimpleForeignKeyDescriptor.java b/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/SimpleForeignKeyDescriptor.java index 4b2282266c..f85d153106 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/SimpleForeignKeyDescriptor.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/SimpleForeignKeyDescriptor.java @@ -424,7 +424,7 @@ public class SimpleForeignKeyDescriptor implements ForeignKeyDescriptor, BasicVa @Override public Object disassemble(Object value, SharedSessionContractImplementor session) { - return value; + return getJdbcMapping().convertToRelationalValue( value ); } @Override @@ -460,7 +460,7 @@ public class SimpleForeignKeyDescriptor implements ForeignKeyDescriptor, BasicVa @Override public void breakDownJdbcValues(Object domainValue, JdbcValueConsumer valueConsumer, SharedSessionContractImplementor session) { - valueConsumer.consume( domainValue, keySide.getModelPart() ); + valueConsumer.consume( disassemble( domainValue, session ), keySide.getModelPart() ); } @Override @@ -506,7 +506,7 @@ public class SimpleForeignKeyDescriptor implements ForeignKeyDescriptor, BasicVa int offset, JdbcValuesConsumer valuesConsumer, SharedSessionContractImplementor session) { - valuesConsumer.consume( offset, value, targetSide.getModelPart().getJdbcMapping() ); + valuesConsumer.consume( offset, disassemble( value, session ), targetSide.getModelPart().getJdbcMapping() ); return getJdbcTypeCount(); }