Hibernate version: 2.1.7
Hi,
we are using in a spatial data application the criteria api to encapsulate complex spatial queries. in our database the geometries appear as object columns. these are transformed in jjava objects by using user types. the problem now is to transform objects from one spatial reference system in to another. because sometimes another spatial reference system is needed as it is in the database. the function we are using is the Oracle Spatial function
Code:
sdo_cs.transform
At the moment we are using HQL-queries or createSQLQuery as the following one:
Code:
Query q = this.getSession().createSQLQuery(
"SELECT " +
"{this}.ID as ID0_, " +
"{this}.NAME as NAME0_, " +
"{this}.DESCRIPTION as DESCRIPT3_0_, " +
"{this}.X_SPACING as X_SPACING0_, " +
"{this}.Y_SPACING as Y_SPACING0_, " +
"{this}.X_COUNT as X_COUNT0_, " +
"{this}.Y_COUNT as Y_COUNT0_, " +
"sdo_cs.transform({this}.LL_POINT, " + sc.getSrs().getSrid() + ") as LL_POINT0_, " +
"sdo_cs.transform({this}.MBB, " + sc.getSrs().getSrid() + ") as MBB0_, " +
"{this}.Z_ORDINATES as Z_ORDIN10_0_ " +
"from Grid {this} WHERE " + se.toSqlString(null, null, null, null) + " ", "this", Grid.class);
As you can see some columns are transformed. how is it possible to extent Hibernate that if one attribut or column class identifies one special typ automatically a function is added?
thanks for help,
elnacho