Dialect warnings

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Dialect warnings

Robert Kovacs
Hello

I am developing a spatial client server application.

I have deployed an initial test version on to a jboss 7 application server.

I am using:
- oracle 11g db with sdo_geometry
- ojdbc6 oracle drivers
- hibernate-spatial-1.0-M2
- hibernate-spatial.oracle-1.0-M2
- org.hibernatespatial.oracle.OracleSpatial10gDialect

When I make a request to the server the server opens a session to the db and I get a couple of hundred lines of:

"[Oracle9Dialect] The Oracle9Dialect dialect has been deprecated; use either Oracle9iDialect or Oracle10gDialect instead"

Any ideas ??

I also had an error when validating the db when the sessionfactory was created:

 Found: sdo_geometry, expected: MDSYS.SDO_GEOMETRY

but my variable in the bean is declared using:

    @Column(name="ROOM_SDO_GEOMETRY")
    @Type(type = "org.hibernatespatial.GeometryUserType")
    private Geometry roomSdoGeometry;

I have managed to get around this by commenting out the

<property name="hibernate.hbm2ddl.auto">validate</property>

in the hibernate config.

When I use a hbm.xml config file for the object and define the column as follows:

        <property name="sdoGeometry">
            <column name="SDO_GEOMETRY" sql-type="MDSYS.SDO_GEOMETRY"/>
            <type name="org.hibernatespatial.GeometryUserType">
                <param name="dialect">
                    org.hibernatespatial.oracle.OracleSpatial10gDialect
                </param>
            </type>
        </property>

Any ideas?

Thanks in advance for any hints or tips on these 2

Robert




_______________________________________________
hibernatespatial-users mailing list
[hidden email]
http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users
Reply | Threaded
Open this post in threaded view
|

Re: Dialect warnings

Daniel Beer

Hi,

 

the deprecation Warning is generated because the OracleSpatialDialect extends Oracle9iDialect instead of Oracle10gDialect.

The only difference is the generation of join statements (10g uses ansi-style joins).

 

The validation problem is caused by Oracle itself because sdo_geometry is an alias for MDSYS.SDO_GEOMETRY in the database, which is used in favor of the fully qualified name. To circumvent this problem just change your hbm.xml definition to

sql-type="sdo_geometry"

or as annotation

@Column(name = "ROOM_SDO_GEOMETRY", columnDefinition = "sdo_geometry")

and everything is fine.

 

Daniel

 

Von: [hidden email] [mailto:[hidden email]] Im Auftrag von Robert Kovacs
Gesendet: Sonntag, 22. Juli 2012 22:22
An: [hidden email]
Betreff: [hibernatespatial-users] Dialect warnings

 

Hello

I am developing a spatial client server application.

I have deployed an initial test version on to a jboss 7 application server.

I am using:
- oracle 11g db with sdo_geometry
- ojdbc6 oracle drivers
- hibernate-spatial-1.0-M2
- hibernate-spatial.oracle-1.0-M2
- org.hibernatespatial.oracle.OracleSpatial10gDialect

When I make a request to the server the server opens a session to the db and I get a couple of hundred lines of:

"[Oracle9Dialect] The Oracle9Dialect dialect has been deprecated; use either Oracle9iDialect or Oracle10gDialect instead"

Any ideas ??

I also had an error when validating the db when the sessionfactory was created:

 Found: sdo_geometry, expected: MDSYS.SDO_GEOMETRY

but my variable in the bean is declared using:

    @Column(name="ROOM_SDO_GEOMETRY")
    @Type(type = "org.hibernatespatial.GeometryUserType")
    private Geometry roomSdoGeometry;

I have managed to get around this by commenting out the

<property name="hibernate.hbm2ddl.auto">validate</property>

in the hibernate config.

When I use a hbm.xml config file for the object and define the column as follows:

        <property name="sdoGeometry">
            <column name="SDO_GEOMETRY" sql-type="MDSYS.SDO_GEOMETRY"/>
            <type name="org.hibernatespatial.GeometryUserType">
                <param name="dialect">
                    org.hibernatespatial.oracle.OracleSpatial10gDialect
                </param>
            </type>
        </property>

Any ideas?

Thanks in advance for any hints or tips on these 2

Robert



_______________________________________________
hibernatespatial-users mailing list
[hidden email]
http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users
Reply | Threaded
Open this post in threaded view
|

Re: Dialect warnings

Robert Kovacs
Thanks for this reply. This worked.

I upgraded to 4.0M1 and now I do not get anymore warnings.

On 23 July 2012 08:58, Daniel Beer <[hidden email]> wrote:

Hi,

 

the deprecation Warning is generated because the OracleSpatialDialect extends Oracle9iDialect instead of Oracle10gDialect.

The only difference is the generation of join statements (10g uses ansi-style joins).

 

The validation problem is caused by Oracle itself because sdo_geometry is an alias for MDSYS.SDO_GEOMETRY in the database, which is used in favor of the fully qualified name. To circumvent this problem just change your hbm.xml definition to

sql-type="sdo_geometry"

or as annotation

@Column(name = "ROOM_SDO_GEOMETRY", columnDefinition = "sdo_geometry")

and everything is fine.

 

Daniel

 

Von: [hidden email] [mailto:[hidden email]] Im Auftrag von Robert Kovacs
Gesendet: Sonntag, 22. Juli 2012 22:22
An: [hidden email]
Betreff: [hibernatespatial-users] Dialect warnings

 

Hello

I am developing a spatial client server application.

I have deployed an initial test version on to a jboss 7 application server.

I am using:
- oracle 11g db with sdo_geometry
- ojdbc6 oracle drivers
- hibernate-spatial-1.0-M2
- hibernate-spatial.oracle-1.0-M2
- org.hibernatespatial.oracle.OracleSpatial10gDialect

When I make a request to the server the server opens a session to the db and I get a couple of hundred lines of:

"[Oracle9Dialect] The Oracle9Dialect dialect has been deprecated; use either Oracle9iDialect or Oracle10gDialect instead"

Any ideas ??

I also had an error when validating the db when the sessionfactory was created:

 Found: sdo_geometry, expected: MDSYS.SDO_GEOMETRY

but my variable in the bean is declared using:

    @Column(name="ROOM_SDO_GEOMETRY")
    @Type(type = "org.hibernatespatial.GeometryUserType")
    private Geometry roomSdoGeometry;

I have managed to get around this by commenting out the

<property name="hibernate.hbm2ddl.auto">validate</property>

in the hibernate config.

When I use a hbm.xml config file for the object and define the column as follows:

        <property name="sdoGeometry">
            <column name="SDO_GEOMETRY" sql-type="MDSYS.SDO_GEOMETRY"/>
            <type name="org.hibernatespatial.GeometryUserType">
                <param name="dialect">
                    org.hibernatespatial.oracle.OracleSpatial10gDialect
                </param>
            </type>
        </property>

Any ideas?

Thanks in advance for any hints or tips on these 2

Robert



_______________________________________________
hibernatespatial-users mailing list
[hidden email]
http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users



_______________________________________________
hibernatespatial-users mailing list
[hidden email]
http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users