Is DataNucleus (latest 5.1.1) JPA 2.1 compliant?
JPA 2.1 supports @Converter. But DataNucleus has its own way (as extension) ignoring JPA standard:
http://www.datanucleus.org/documentation/extensions/type_converter.html
UPDATE
The same code with AttributeConverter works for EclipseLink, but failed with DataNucleus.
@Converter(autoApply=true)
public class FooConverter implements AttributeConverter<Foo, String> {
@Override
public String convertToDatabaseColumn(Foo attribute) {
....
}
@Override
public Foo convertToEntityAttribute(String value) {
...
}
}
@Entity
public class Bar {
@Convert(converter=FooConverter.class)
public Foo getFoo() {
...
}
public void setFoo(Foo foo) {
...
}
}
Error:
org.datanucleus.exceptions.NucleusUserException: Identifier hello.world is unresolved (not a static field)
at org.datanucleus.query.expression.PrimaryExpression.bind(PrimaryExpression.java:215)
at org.datanucleus.query.expression.DyadicExpression.bind(DyadicExpression.java:131)
at org.datanucleus.query.expression.DyadicExpression.bind(DyadicExpression.java:131)
at org.datanucleus.query.expression.DyadicExpression.bind(DyadicExpression.java:89)
at org.datanucleus.query.compiler.JavaQueryCompiler.compileFilter(JavaQueryCompiler.java:617)
at org.datanucleus.query.compiler.JPQLCompiler.compile(JPQLCompiler.java:86)
at org.datanucleus.store.query.AbstractJPQLQuery.compileGeneric(AbstractJPQLQuery.java:304)
at org.datanucleus.store.query.AbstractJPQLQuery.compileInternal(AbstractJPQLQuery.java:365)
The 'hello.world' in error message is the string value of Foo.