I'm using JPA 2.0. Is it possible to map an Entity's attribute (column) to the result of a function and then control the way it's persisted too?
Note: This is related to PostGIS. Since there is no native support for Geometry types in JPA/EclipseLink, I might do something like this:
@Entity
public class Foo {
@Column(name="geom", appendBeforeChange( ST_FromKml ))
public String kmlString;
}
In other words, I could store the geometry as a String in Java, but when EclipseLink writes it to the database, it should first call the database function ST_FromKml and provide the String, which will convert it to the Geometry type in the database...
I know it's a stretch, but figured I would ask...