Last active
August 13, 2021 04:48
-
-
Save geobabbler/bdc405c5d25ba2b45d81 to your computer and use it in GitHub Desktop.
Simple extension to PostGIS dialect for Hibernate
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
package com.geomusings.dialect; | |
//import org.hibernate.dialect.PostgreSQLDialect; | |
import org.hibernate.dialect.function.StandardSQLFunction; | |
import org.hibernate.type.CustomType; | |
import org.hibernate.type.StandardBasicTypes; | |
import org.hibernate.type.Type; | |
import org.hibernate.spatial.dialect.postgis.PostgisDialect; | |
import org.hibernate.usertype.UserType; | |
import org.hibernate.spatial.SpatialAggregate; | |
import org.hibernate.spatial.SpatialDialect; | |
import org.hibernate.spatial.SpatialFunction; | |
import org.hibernate.spatial.SpatialRelation; | |
/** | |
* | |
* @author dollinsw | |
*/ | |
public class PostgisDialectExtensions extends PostgisDialect { | |
public PostgisDialectExtensions(){ | |
super(); | |
registerFunction("asgeojson", new StandardSQLFunction("st_asgeojson", | |
StandardBasicTypes.STRING)); | |
registerFunction("asgml", new StandardSQLFunction("st_asgml", | |
StandardBasicTypes.STRING)); | |
registerFunction("askml", new StandardSQLFunction("st_askml", | |
StandardBasicTypes.STRING)); | |
registerFunction("srid", new StandardSQLFunction("st_srid", | |
StandardBasicTypes.INTEGER)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment