Hibernate Layer

This page was last edited by FrankM on Wed, 27/02/2013 - 13:40

Summary - Hibernate Layer
Maintainer:

Pieter De Graef

Plug-in Type:Layer implementation
Status:Graduated  Code Style rating Provenance review rating Documentation rating Test coverage rating
Compatibility: back-end
Support Type:Official Geomajas plug-in

Community & Documentation

Plug-in description

Note from the Geomajas team: When working with databases, it is recommended to always use this plug-in!

This plug-in provides a vector layer implementation that makes use of Hibernate Spatial, which is a GIS extension of the Hibernate Object Relational Mapping (ORM) technology.

This plug-in is essential in streamlining Geomajas with the familiar domain modelling practices of mainstream Java programmers. Using this layer, it is possible to define complex attribute relations, including many-to-one and one-to-many associations. 

Supported databases:

  • PostGIS
  • Oracle Spatial
  • Microsoft SQL Server
  • MySQL

As with all ORM technologies, in Hibernate, you declare Java POJO objects and map them to the underlying database. These mappings can be defined with annotations (java 1.5).

When using this module to define a new layer, simply use the java class of the POJO objects in the XML configuration. Names of the attributes in XML are automatically translated to getters and setters in the java objects. What's more, if a java object contains many-to-one's or one-to-many relationschips (and therefore lists of other mapped java objects), one can simply define these as "associations" in the XML layer configurations, and this module will do the rest.

Using this plug-in in Maven

In order to use this plug-in in your Maven-project, add the following dependency to the pom.xml:

	<dependency>
		<groupId></groupId>
		<artifactId></artifactId>
	</dependency>