geolatte-geom-jpa

Geolatte-JPA Converters

APACHE-2.0 License

Stars
4
Committers
1

geolatte-geom-jpa

Geolatte is a small, focused java GIS project. This library adds converters for persisting and loading Geolatte types using the jpa provider shipped with EE 7. For support for EE6 using the EclipseLink JPA provider see the geolatte-geom-eclipselink project.

Usage

The user should be able to use any of the Geolatte spatial types within a persistent entity. To activate the relevant converter needs to be added to the persistence.xml file.

For Postgres use;

<class>org.realityforge.jeo.geolatte.jpa.PostgisConverter</class>

For Sql Server use;

<class>org.realityforge.jeo.geolatte.jpa.SqlServerConverter</class>

Then you simply annotate the jpa field with a convert annotation as appropriate.

For Postgres use;

  @Column( name = "geom1" )
  @Convert( converter = PostgisConverter.class )
  private Geometry _geom1;

  @Column( name = "geom2" )
  @Convert( converter = PostgisConverter.class )
  private Point _geom2;

For Sql Server use;

  @Column( name = "geom1" )
  @Convert( converter = SqlServerConverter.class )
  private Geometry _geom1;

  @Column( name = "geom2" )
  @Convert( converter = SqlServerConverter.class )
  private Point _geom2;

Package Rankings
Top 38.92% on Repo1.maven.org
Badges
Extracted from project README
Build Status