I don't really understand a lot about what's going on, but I think I know what needs to change. Lines 383-396 of org.hibernate.mapping.SimpleValue are as follows:
// AttributeConverter works totally in memory, meaning it converts between one Java representation (the entity
// attribute representation) and another (the value bound into JDBC statements or extracted from results).
// However, the Hibernate Type system operates at the lower level of actually dealing with those JDBC objects.
// So even though we have an AttributeConverter, we still need to "fill out" the rest of the BasicType
// data. For the JavaTypeDescriptor portion we simply resolve the "entity attribute representation" part of
// the AttributeConverter to resolve the corresponding descriptor. For the SqlTypeDescriptor portion we use the
// "database column representation" part of the AttributeConverter to resolve the "recommended" JDBC type-code
// and use that type-code to resolve the SqlTypeDescriptor to use.
finalClass entityAttributeJavaType = jpaAttributeConverterDefinition.getEntityAttributeType();
finalClass databaseColumnJavaType = jpaAttributeConverterDefinition.getDatabaseColumnType();
finalint jdbcTypeCode = JdbcTypeJavaClassMappings.INSTANCE.determineJdbcTypeCodeForJavaClass( databaseColumnJavaType );
final JavaTypeDescriptor javaTypeDescriptor = JavaTypeDescriptorRegistry.INSTANCE.getDescriptor( entityAttributeJavaType );
final SqlTypeDescriptor sqlTypeDescriptor = SqlTypeDescriptorRegistry.INSTANCE.getDescriptor( jdbcTypeCode );
In this case, JavaTypeDescriptorRegistry.INSTANCE.getDescriptor will return a value based on the field type, not based on the type that the converter converts it to. It SHOULD be base on the type the converter converts it to:
final JavaTypeDescriptor javaTypeDescriptor = JavaTypeDescriptorRegistry.INSTANCE.getDescriptor( databaseColumnJavaType );
Now this will return the correct value. In theory. But, like I said, I could be missing something.
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
I don't really understand a lot about what's going on, but I think I know what needs to change. Lines 383-396 of org.hibernate.mapping.SimpleValue are as follows:
In this case, JavaTypeDescriptorRegistry.INSTANCE.getDescriptor will return a value based on the field type, not based on the type that the converter converts it to. It SHOULD be base on the type the converter converts it to:
final JavaTypeDescriptor javaTypeDescriptor = JavaTypeDescriptorRegistry.INSTANCE.getDescriptor( databaseColumnJavaType );Now this will return the correct value. In theory. But, like I said, I could be missing something.