[postgis-users] RE: RE: PostGIS - hibernate - EJB3
coster
christian.osterrieder at salzburgresearch.at
Mon Sep 11 04:27:06 PDT 2006
Hallo Daniel,
thank you for your solution, it works fine for me.
But there is another problem:
If I try to store my geometry data I get the following error:
Caused by: org.postgresql.util.PSQLException: Unzulässiger Wert für den Typ
int : 010100000000000000000025406666666666662040.
at
org.postgresql.jdbc2.AbstractJdbc2ResultSet.toInt(AbstractJdbc2ResultSet.java:2507)
at
org.postgresql.jdbc2.AbstractJdbc2ResultSet.getInt(AbstractJdbc2ResultSet.java:1994)
at org.postgresql.jdbc3.Jdbc3ResultSet.getBlob(Jdbc3ResultSet.java:54)
at
org.postgresql.jdbc2.AbstractJdbc2ResultSet.getBlob(AbstractJdbc2ResultSet.java:323)
at
org.jboss.resource.adapter.jdbc.WrappedResultSet.getBlob(WrappedResultSet.java:378)
at
at.srfg.dataAccessLayer.persistance.hibernate.GeometryType.nullSafeGet(GeometryType.java:63)
I use a simple Point for testing it:
double x = 10.50;
double y = 8.20;
Geometry geometry = new org.postgis.Point(x,y);
Thank you for your help,
Christian.
D. Martinez wrote:
>
> Hello,
> I implemented Norman's solution and got the same problem, with the column
> getting defined as 'oid' instead of 'geometry'.
> I finally found a fix that worked for me. It's actually very simple. All I
> do is set a 'columnDefinition' for the field in the EJB entity bean. Like
> this.
>
> @Type(type="mycode.ejb.par.GeometryType")
> @Column(name="LOCATION",columnDefinition="geometry")
> public org.postgis.Geometry getPoint() {
> return _point;
> }
>
> I set the 'columnDefinition' to 'geometry', and it seems to work. The
> column gets created as type 'geometry'.
>
> Hope this helps.
>
> Norman, thanks for your solution!
>
> Daniel
>
>
>
> ---------------------------------
> Do you Yahoo!?
> Get on board. You're invited to try the new Yahoo! Mail.
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>
--
View this message in context: http://www.nabble.com/PostGIS---hibernate---EJB3-tf2064211.html#a6244904
Sent from the PostGIS - User forum at Nabble.com.
More information about the postgis-users
mailing list