Dear all,
has anyone experimented with schema validation of the database where
hibernate spatial has created the tables? my problem is that in the
installer to me application I want to verify if the database passed in
by the user is already used to persist my objects. I thought to use
SchemaValidator tool included in Hibernate's suite (see
http://docs.jboss.org/hibernate/stable/core/reference/en/html/toolsetguide.html#toolsetguide-s1-8).
The validation works but not for tables with geometry tables in it:
Sep 17, 2009 11:50:51 AM org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: table found: CSD_LUKE.NSIL_COVERAGE
Sep 17, 2009 11:50:51 AM org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: columns: [temporalend, id, spatialgeographicreferencebox,
temporalstart, spatialcountrycode]
Sep 17, 2009 11:50:51 AM org.hibernatespatial.HBSpatialExtension <clinit>
INFO: Initializing HBSpatialExtension
Sep 17, 2009 11:50:51 AM org.hibernatespatial.HBSpatialExtension <clinit>
INFO: Attempting to load Hibernate Spatial Provider
org.hibernatespatial.oracle.DialectProvider
Sep 17, 2009 11:50:51 AM org.hibernate.dialect.Dialect <init>
INFO: Using dialect: org.hibernatespatial.oracle.OracleSpatial10gDialect
Sep 17, 2009 11:50:51 AM org.hibernate.dialect.Oracle9Dialect <init>
WARNING: The Oracle9Dialect dialect has been deprecated; use either
Oracle9iDialect or Oracle10gDialect instead
Sep 17, 2009 11:50:51 AM org.hibernatespatial.HBSpatialExtension <clinit>
INFO: Hibernate Spatial configured. Using dialect:
org.hibernatespatial.oracle.OracleSpatial10gDialect
Sep 17, 2009 11:50:51 AM
org.hibernate.connection.DriverManagerConnectionProvider close
INFO: cleaning up connection pool: jdbc:oracle:thin:@oracle-v:1521:csd
Sep 17, 2009 11:50:51 AM org.hibernate.tool.hbm2ddl.SchemaValidator main
SEVERE: Error running schema update
org.hibernate.HibernateException: Wrong column type:
spatialGeographicReferenceBox, expected: MDSYS.SDO_GEOMETRY
at org.hibernate.mapping.Table.validateColumns(Table.java:261)
at org.hibernate.cfg.Configuration.validateSchema(Configuration.java:1083)
at org.hibernate.tool.hbm2ddl.SchemaValidator.validate(SchemaValidator.java:116)
at org.hibernate.tool.hbm2ddl.SchemaValidator.main(SchemaValidator.java:85)
org.hibernate.HibernateException: Wrong column type:
spatialGeographicReferenceBox, expected: MDSYS.SDO_GEOMETRY
at org.hibernate.mapping.Table.validateColumns(Table.java:261)
at org.hibernate.cfg.Configuration.validateSchema(Configuration.java:1083)
at org.hibernate.tool.hbm2ddl.SchemaValidator.validate(SchemaValidator.java:116)
at org.hibernate.tool.hbm2ddl.SchemaValidator.main(SchemaValidator.java:85)
The offending hibernate mapping file looks like that:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD
3.0//EN" "
http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class table="NSIL_COVERAGE"
name="int_.nato.nc3a.nsili.server2.model.majiic.NSIL_COVERAGE">
<id access="property" name="id">
<generator class="native"/>
</id>
<property name="spatialCountryCode" length="20"
column="spatialCountryCode"/>
<property name="spatialGeographicReferenceBox"
type="org.hibernatespatial.GeometryUserType"
column="spatialGeographicReferenceBox" />
<property name="temporalEnd" column="temporalEnd"/>
<property name="temporalStart" column="temporalStart"/>
</class>
</hibernate-mapping>
Any ideas?
thanks!
Lukasz
_______________________________________________
hibernatespatial-users mailing list
[hidden email]
http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users