When using a AttributeConverter for DB-value Character, the value does not get escaped. Here is my sampleconverter.
public class SampleConverter<E extends MyEnum> implements AttributeConverter<E, Character> {
@Override
public Character convertToDatabaseColumn(E attribute) {
return attribute == null ? null : attribute.getCharacter();
}
@Override
public E convertToEntityAttribute(Character dbData) {
return ...;
}
}
I made a workaround with overloading an own version of org.hibernate.hql.internal.ast.tree.JavaConstantNode with following changes on line 81:
final Object value = converterType.getAttributeConverter().convertToDatabaseColumn( constantValue );
if ( String.class.equals( converterType.getJdbcType() ) || Character.class.equals(converterType.getJdbcType()) ) {
return "'" + value + "'";
}
else {
return value.toString();
}
I came to this error after upgrading to Spring Boot 1.5.4.RELEASE |