mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#239 - Support Geometric types of Postgres, Also adding LineString, MultiLineString and MultiPoint
This commit is contained in:
@@ -21,6 +21,9 @@ public class DbPlatformTypeMapping {
|
||||
|
||||
private static final DbPlatformType POINT = new DbPlatformType("point");
|
||||
private static final DbPlatformType POLYGON = new DbPlatformType("polygon");
|
||||
private static final DbPlatformType LINESTRING = new DbPlatformType("linestring");
|
||||
private static final DbPlatformType MULTIPOINT = new DbPlatformType("multipoint");
|
||||
private static final DbPlatformType MULTILINESTRING = new DbPlatformType("multilinestring");
|
||||
private static final DbPlatformType MULTIPOLYGON = new DbPlatformType("multipolygon");
|
||||
|
||||
private final Map<DbType, DbPlatformType> typeMap = new HashMap<DbType, DbPlatformType>();
|
||||
@@ -68,6 +71,9 @@ public class DbPlatformTypeMapping {
|
||||
|
||||
put(DbType.POINT, POINT);
|
||||
put(DbType.POLYGON, POLYGON);
|
||||
put(DbType.LINESTRING, LINESTRING);
|
||||
put(DbType.MULTIPOINT, MULTIPOINT);
|
||||
put(DbType.MULTILINESTRING, MULTILINESTRING);
|
||||
put(DbType.MULTIPOLYGON, MULTIPOLYGON);
|
||||
|
||||
if (logicalTypes) {
|
||||
|
||||
@@ -38,6 +38,9 @@ public enum DbType {
|
||||
|
||||
POINT(ExtraDbTypes.POINT),
|
||||
POLYGON(ExtraDbTypes.POLYGON),
|
||||
LINESTRING(ExtraDbTypes.LINESTRING),
|
||||
MULTIPOINT(ExtraDbTypes.MULTIPOINT),
|
||||
MULTILINESTRING(ExtraDbTypes.MULTILINESTRING),
|
||||
MULTIPOLYGON(ExtraDbTypes.MULTIPOLYGON),
|
||||
|
||||
HSTORE(ExtraDbTypes.HSTORE),
|
||||
|
||||
@@ -50,9 +50,24 @@ public interface ExtraDbTypes {
|
||||
*/
|
||||
int POLYGON = 6001;
|
||||
|
||||
/**
|
||||
* Geo Point
|
||||
*/
|
||||
int LINESTRING = 6002;
|
||||
|
||||
/**
|
||||
* Geo MultiPolygon
|
||||
*/
|
||||
int MULTIPOLYGON = 6002;
|
||||
int MULTIPOINT = 6005;
|
||||
|
||||
/**
|
||||
* Geo MultiPolygon
|
||||
*/
|
||||
int MULTIPOLYGON = 6006;
|
||||
|
||||
/**
|
||||
* Geo MultiPolygon
|
||||
*/
|
||||
int MULTILINESTRING = 6007;
|
||||
|
||||
}
|
||||
|
||||
@@ -80,6 +80,9 @@ public class PostgresPlatform extends DatabasePlatform {
|
||||
private void addGeoTypes(int srid) {
|
||||
dbTypeMap.put(DbType.POINT, geoType("point",srid));
|
||||
dbTypeMap.put(DbType.POLYGON, geoType("polygon",srid));
|
||||
dbTypeMap.put(DbType.LINESTRING, geoType("linestring",srid));
|
||||
dbTypeMap.put(DbType.MULTIPOINT, geoType("multipoint",srid));
|
||||
dbTypeMap.put(DbType.MULTILINESTRING, geoType("multilinestring",srid));
|
||||
dbTypeMap.put(DbType.MULTIPOLYGON, geoType("multipolygon",srid));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user