What kind of databases does hibernate spatial support?

What kind of databases does hibernate spatial support?

Although Hibernate spatial supports different databases like Oracle, MySQL, PostgreSQLql/PostGIS, and a few others, the support for the database specific functions isn’t uniform. It’s better to refer to the latest Hibernate documentation to check the list of functions for which hibernate provides support for a given database.

How to use Hibernate spatial in persistence.xml?

Hibernate Spatial extends the Hibernate Dialects so that the spatial functions of the database are available within HQL and JPQL. So instead of using the (in our case) PostgreSQLDialect, we use Hibernate Spatial’s extension of that dialect which is the PostGISDialect. Our persistence.xml looks like this:

How is hibernate spatial used in JPQL and HQL?

Hibernate Spatial extends the Hibernate Dialects so that the spatial functions of the database are available within HQL and JPQL. So instead of using the (in our case) PostgreSQLDialect, we use Hibernate Spatial’s extension of that dialect which is the PostGISDialect.

How to create event in hibernate spatial tutorial?

For this example, we specify type (the default) and set groupId to org.hibernate.spatial.tutorials, artifactId to event-tutorial and package to event. mvn archetype:generate [INFO] Scanning for projects…

What are the Maven dependencies for hibernate spatial?

When I included the maven dependency for hibernate-spatial, it has a transitive dependency for hibernate itself, postgresql’s jdbc and postgis’s jdbc. So what I did was to remove these dependencies (outdated).

Why do I get a PostGIS psqlexception?

Caused by: org.postgresql.util.PSQLException: Can’t infer the SQL type to use for an instance of org.postgis.PGgeometry. Use setObject () with an explicit Types value to specify the type to use.

Which is the PostGIS extension to PostgreSQL JDBC?

Postgis jdbc is the extension to postgresql jdbc that you need. Then I cloned postgis repository and compiled their jdbc extension. Just run mvn package in the java/jdbc directory. Read its readme. On the tomcat’s server configuration, I changed the database url to jdbc:postgresql_postGIS://localhost:5432/mydatabase.