When using a AttributeConverter for DB-value Character, the value does not get escaped. Here is my sampleconverter.
{code} 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 ...; } } {code}
I made a workaround with overloading an own version of {{org.hibernate.hql.internal.ast.tree.JavaConstantNode}} with following changes on line 81:
{code} final Object value = converterType.getAttributeConverter().convertToDatabaseColumn( constantValue ); if ( String.class.equals( converterType.getJdbcType() ) || Character.class.equals(converterType.getJdbcType()) ) { return "'" + value + "'"; } else { return value.toString(); } {code}
I came to got this error after upgrading to {{Spring Boot 1.5.4.RELEASE}} |
|