I have this code:
@Column(name = "foo")
@ReadTransformer(transformerClass=transformer.class)
private Date foo;
public static class transformer implements AttributeTransformer {
@Override
public void initialize(AbstractTransformationMapping atm) {
}
@Override
public Object buildAttributeValue(Record record, Object o, Session sn) {
}
}
My question is, how do I get the value to transform (from column foo) inside of buildAttributeVaule? It is not inside the record array.
You need one or more @WriteTransformer to write the fields you want selected (and thus get them selected), @Column is not used with a transformation mapping.
However, if you just have a single column, then just use a converter instead, @Convert,
http://wiki.eclipse.org/EclipseLink/UserGuide/JPA/Basic_JPA_Development/Mapping/Basic_Mappings/Default_Conversions_and_Converters