Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merged example from hibernatespatial tutorial
- Loading branch information
1 parent
4fdfe54
commit 6f693b4
Showing
6 changed files
with
169 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
.classpath | ||
.project | ||
target/ | ||
/.settings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.devcrumb.dao; | ||
|
||
import org.springframework.data.repository.CrudRepository; | ||
import org.springframework.stereotype.Repository; | ||
|
||
import com.devcrumb.model.Event; | ||
|
||
/** | ||
* Person dao interface | ||
* | ||
* @author DevCrumb.com | ||
*/ | ||
@Repository | ||
public interface EventDao extends CrudRepository<Event, Long> { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
package com.devcrumb.model; | ||
|
||
import com.vividsolutions.jts.geom.Point; | ||
import org.hibernate.annotations.GenericGenerator; | ||
import org.hibernate.annotations.Type; | ||
|
||
import javax.persistence.*; | ||
import java.util.Date; | ||
|
||
@Entity | ||
public class Event { | ||
|
||
@Id | ||
@GeneratedValue(generator = "increment") | ||
@GenericGenerator(name = "increment", strategy = "increment") | ||
private Long id; | ||
|
||
private String title; | ||
|
||
private Date date; | ||
|
||
@Type(type = "org.hibernate.spatial.GeometryType") | ||
private Point location; | ||
|
||
public Event() { | ||
} | ||
|
||
public Long getId() { | ||
return id; | ||
} | ||
|
||
public void setId(Long id) { | ||
this.id = id; | ||
} | ||
|
||
public Date getDate() { | ||
return date; | ||
} | ||
|
||
public void setDate(Date date) { | ||
this.date = date; | ||
} | ||
|
||
public String getTitle() { | ||
return title; | ||
} | ||
|
||
public void setTitle(String title) { | ||
this.title = title; | ||
} | ||
|
||
public Point getLocation() { | ||
return this.location; | ||
} | ||
|
||
public void setLocation(Point location) { | ||
this.location = location; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "Event [id=" + id + ", title=" + title + ", date=" + date | ||
+ ", location=" + location + "]"; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters