Hello,
sorry for the late reply.
Now I'm not using the special Records from tables.records anymore.
I replace the geometry field in the table's class with
public final Field<?> POSITION = Factory.fieldByName("position");
>
For reading I add all fields I want to a list of fields.
This list is then used in
> create.select(listOfFields).from(...)
>
The geometry field for postgres looks like this.
> Factory.field("ST_AsText(position)).as("position");
>
This reads the geometry as a wkt string.
After fetching the result records I get this field's content as a String.
> record.getValueAsString(table.POSITION);
>
I think to use the special records one must create a special field class
which uses the appropriate sql functions to read and write geometry as a
wkt string.
This way the user could decide for himself which java geometry class he
wants to use. He just have to create the geometry object from the wkt
string.
For writing the geometry I use
>
> map.put(table.POSITION,Factory.field("ST_GeomFromText("+wktGeometryString+")"));
>
PostGIS can create geometry columns in the database's table. This way it is
possible to do an area search within the database to select only rows which
are located inside a given polygon, for example.
I mean the geometry is stored in an internal format within the database
which neither has anything to do with org.postgis.Point itself nor is
stored as a string.
As seen above it would be necessary to use the sql functions to read and
write the geometry.
Greetings from Dresden