BAEL-1334 Guide to Hibernate Spatial (#3211)

* BAEL-1334 Guide to Hibernate Spatial

* BAEL-1334 Guide to Hibernate Spatial

Moving the files to hibernate5 from libraries

* Reverting the pom file

* BAEL-1334 Guide to Hibernate Spatial

* BAEL-1334 Guide to Hibernate Spatial

Moving the files to hibernate5 from libraries

* Reverting the pom file

* BAEL-1334 Guide to Hibernate Spatial

Improved assertions

* Add examples related to circle
This commit is contained in:
YasinBhojawala
2017-12-10 13:47:49 +05:30
committed by Grzegorz Piwowarek
parent 763f0d59c5
commit f9f5a82cf4
3 changed files with 87 additions and 0 deletions

View File

@@ -6,6 +6,7 @@ import com.baeldung.hibernate.pojo.OrderEntry;
import com.baeldung.hibernate.pojo.OrderEntryIdClass;
import com.baeldung.hibernate.pojo.OrderEntryPK;
import com.baeldung.hibernate.pojo.PointEntity;
import com.baeldung.hibernate.pojo.PolygonEntity;
import com.baeldung.hibernate.pojo.Product;
import com.baeldung.hibernate.pojo.Phone;
import com.baeldung.hibernate.pojo.TemporalValues;
@@ -79,6 +80,7 @@ public class HibernateUtil {
metadataSources.addAnnotatedClass(Car.class);
metadataSources.addAnnotatedClass(Bag.class);
metadataSources.addAnnotatedClass(PointEntity.class);
metadataSources.addAnnotatedClass(PolygonEntity.class);
Metadata metadata = metadataSources.buildMetadata();
return metadata.getSessionFactoryBuilder()

View File

@@ -0,0 +1,38 @@
package com.baeldung.hibernate.pojo;
import com.vividsolutions.jts.geom.Polygon;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
@Entity
public class PolygonEntity {
@Id
@GeneratedValue
private Long id;
private Polygon polygon;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Polygon getPolygon() {
return polygon;
}
public void setPolygon(Polygon polygon) {
this.polygon = polygon;
}
@Override
public String toString() {
return "PolygonEntity{" + "id=" + id + ", polygon=" + polygon + '}';
}
}