It's nice library which allows Hibernate to use geolocalization data - with few simple criteria queries you can search e.g. events in proximity of some place.
Some examples from their tutorial:
private List find(String wktFilter){
WKTReader fromText = new WKTReader();
Geometry filter = null;
try{
filter = fromText.read(wktFilter);
} catch(ParseException e){
throw new RuntimeException("Not a WKT String:" + wktFilter);
}
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
session.beginTransaction();
System.out.println("Filter is : " + filter);
Criteria testCriteria = session.createCriteria(Event.class);
testCriteria.add(SpatialRestrictions.within("location", filter));
List results = testCriteria.list();
session.getTransaction().commit();
return results;
}
Annotations are also supported:
@Type(type = "org.hibernatespatial.GeometryUserType")
private Point location;
Recent comments
1 year 20 weeks ago
1 year 20 weeks ago
1 year 27 weeks ago
1 year 29 weeks ago
1 year 47 weeks ago
1 year 49 weeks ago
1 year 49 weeks ago
1 year 49 weeks ago
1 year 49 weeks ago
1 year 49 weeks ago