I am working with application which uses spring 3.1 and hibernate 4.2. For spatial feature we are planning to use hibernate spatial with postgis. But hibernate spatial creates column with bytea type instead of geometry. I am not able to find out where is root cause of this. I spend already couple of days in resolving but not successful.
hibernate-spatial-4.0.jar is used.
I am using following hibernate.properties file
database.driverClassName=org.postgresql.Driver database.url=jdbc:postgresql://127.0.0.1:5433/mpdb database.username=postgres database.password=postgres hibernate.dialect=org.hibernate.spatial.dialect.postgis.PostgisDialect hibernate.show_sql=true hibernate.hbm2ddl.auto=update I am using following annotation in Entity
@Column(columnDefinition="Geometry", nullable = true) @Type(type = "org.hibernate.spatial.GeometryType") private Point geom; Application successfully creates following table but instead of geometry type it creates bytea for column geom
Table "public.tile" Column | Type | Modifiers ----------------------------+-----------------------------+----------- id | integer | not null alt | double precision | not null geom | bytea | lat | double precision | not null lng | double precision | not null multipath_table | text | not null multipath_table_min_value | double precision | multipath_table_resolution | integer | multipath_table_tx_id | text | tile_created | timestamp without time zone | not null tile_data_age | integer | tile_data_present | text | not null tile_num_tx | integer | Indexes: "tile_pkey" PRIMARY KEY, btree (id) However manually I am able to create Geometry type column in postgis2.2-postgres9.5 database
I went through almost every thread but unsuccessful. Need help.