Missing

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

Missing

Leo Amigood
Hi!

I am trying to get spatial h2 to work (i was able to get Mysql version to work without any problems).

Somehow h2 does not recognize geometry:
Caused by: org.h2.jdbc.JdbcSQLException: Unknown data type: "POINT"; SQL statement:

CREATE TABLE `location` (
...
  `center_geo` point NOT NULL,
...
  SPATIAL KEY `center_geo` (`center_geo`)
) [50004-166])
        at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1549)
        at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388)
        at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
        at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java:81)
        at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)
        ... 58 more
Caused by: org.h2.jdbc.JdbcSQLException: Unknown data type: "POINT"; SQL statement:

Here is the spring hibernate config:
        <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
            <property name="driverClassName" value="org.h2.Driver"/>
            <property name="url" value="jdbc:h2:mem:dot;INIT=RUNSCRIPT FROM 'target/test-classes/db/h2_init.sql'"/>
        </bean>
        <bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
            <property name="dataSource" ref="dataSource"/>
            <property name="hibernateProperties">
                <value>
                    hibernate.format_sql = true
                    hibernate.show_sql = false
                    hibernate.dialect = org.hibernatespatial.geodb.GeoDBDialect
                    hibernate.connection.release_mode = after_statement
                    hibernate.cache.use_second_level_cache = false
                    hibernate.cache.region.factory_class = net.sf.ehcache.hibernate.SingletonEhCacheRegionFactory
                    hibernate.generate_statistics = true
                </value>
            </property>
        </bean>

Best 'G' regards,
Leo Amigood

_______________________________________________
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: Missing

Jan Boonen
Hi Leo,

H2 uses GeoDB for its spatial extension (see:
https://github.com/jdeolive/geodb for details). Because of this
construct geometry data is stored in blob fields. So to use spatial
functions, you'd create your table as follows:

CREATE TABLE location (
   ...
   center_geo blob NOT NULL
   ...
)

If you whish your DDL files to be compatible with MySQL, you can create
domains:

CREATE DOMAIN point AS BLOB;

Cheers,

Jan

On 6-11-2012 18:37, Leo Amigood wrote:

> Hi!
>
> I am trying to get spatial h2 to work (i was able to get Mysql version
> to work without any problems).
>
> Somehow h2 does not recognize geometry:
> Caused by: org.h2.jdbc.JdbcSQLException: Unknown data type: "POINT";
> SQL statement:
>
> CREATE TABLE `location` (
> ...
>   `center_geo` point NOT NULL,
> ...
>   SPATIAL KEY `center_geo` (`center_geo`)
> ) [50004-166])
>         at
> org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1549)
>         at
> org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388)
>         at
> org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
>         at
> org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java:81)
>         at
> org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)
>         ... 58 more
> Caused by: *org.h2.jdbc.JdbcSQLException: Unknown data type: "POINT";
> SQL statement:*
>
> Here is the spring hibernate config:
>         <bean id="dataSource"
> class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
>             <property name="driverClassName" value="*org.h2.Driver*"/>
>             <property name="url" value="jdbc:h2:mem:dot;INIT=RUNSCRIPT
> FROM 'target/test-classes/db/h2_init.sql'"/>
>         </bean>
>         <bean id="sessionFactory"
> class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
>             <property name="dataSource" ref="dataSource"/>
>             <property name="hibernateProperties">
>                 <value>
>                     hibernate.format_sql = true
>                     hibernate.show_sql = false
> *hibernate.dialect = org.hibernatespatial.geodb.GeoDBDialect*
>                     hibernate.connection.release_mode = after_statement
> hibernate.cache.use_second_level_cache = false
>                     hibernate.cache.region.factory_class =
> net.sf.ehcache.hibernate.SingletonEhCacheRegionFactory
>                     hibernate.generate_statistics = true
>                 </value>
>             </property>
>         </bean>
>
> Best 'G' regards,
> Leo Amigood
>
>
> _______________________________________________
> 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
Reply | Threaded
Open this post in threaded view
|

Re: Missing

Leo Amigood
Jan,

Thank you for your reply.

Your suggestion helped, but now i am facing other issue (similar):

Caused by: org.h2.jdbc.JdbcSQLException: Function "GEOMFROMTEXT" not found; SQL statement

Do i need to have any of the H2 spatial extension (listed in https://groups.google.com/forum/?fromgroups=#!topic/h2-database/pN1AYaIJfZ8 )

Leo


Best 'G' regards,
Leo Amigood


On Tue, Nov 6, 2012 at 2:18 PM, Jan Boonen <[hidden email]> wrote:
Hi Leo,

H2 uses GeoDB for its spatial extension (see: https://github.com/jdeolive/geodb for details). Because of this construct geometry data is stored in blob fields. So to use spatial functions, you'd create your table as follows:


CREATE TABLE location (
  ...
  center_geo blob NOT NULL
  ...
)

If you whish your DDL files to be compatible with MySQL, you can create domains:

CREATE DOMAIN point AS BLOB;

Cheers,

Jan


On 6-11-2012 18:37, Leo Amigood wrote:
Hi!

I am trying to get spatial h2 to work (i was able to get Mysql version to work without any problems).

Somehow h2 does not recognize geometry:
Caused by: org.h2.jdbc.JdbcSQLException: Unknown data type: "POINT"; SQL statement:

CREATE TABLE `location` (
...
  `center_geo` point NOT NULL,
...
  SPATIAL KEY `center_geo` (`center_geo`)
) [50004-166])
        at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1549)
        at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388)
        at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
        at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java:81)
        at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)
        ... 58 more
Caused by: *org.h2.jdbc.JdbcSQLException: Unknown data type: "POINT"; SQL statement:*


Here is the spring hibernate config:
        <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
            <property name="driverClassName" value="*org.h2.Driver*"/>

            <property name="url" value="jdbc:h2:mem:dot;INIT=RUNSCRIPT FROM 'target/test-classes/db/h2_init.sql'"/>
        </bean>
        <bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
            <property name="dataSource" ref="dataSource"/>
            <property name="hibernateProperties">
                <value>
                    hibernate.format_sql = true
                    hibernate.show_sql = false
*hibernate.dialect = org.hibernatespatial.geodb.GeoDBDialect*

                    hibernate.connection.release_mode = after_statement
hibernate.cache.use_second_level_cache = false
                    hibernate.cache.region.factory_class = net.sf.ehcache.hibernate.SingletonEhCacheRegionFactory
                    hibernate.generate_statistics = true
                </value>
            </property>
        </bean>

Best 'G' regards,
Leo Amigood


_______________________________________________
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


_______________________________________________
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: Missing

Jan Boonen
Hi Leo,

For spatial functions you must also define aliases, since GeoDB uses the
new guidelines for naming geospatial functions (using ST_).

Here is an example from one of my source files:

-- Create geometry datatype
CREATE DOMAIN geometry AS BLOB;
CREATE DOMAIN serial AS INT;
CREATE DOMAIN bigserial AS BIGINT;

-- Register aliases for spatial functions
CREATE ALIAS CreateSpatialIndex for "geodb.GeoDB.CreateSpatialIndex";
CREATE ALIAS DropSpatialIndex for "geodb.GeoDB.DropSpatialIndex";
CREATE ALIAS EnvelopeAsText for "geodb.GeoDB.EnvelopeAsText";
CREATE ALIAS GeometryType for "geodb.GeoDB.GeometryType";
CREATE ALIAS ST_Area FOR "geodb.GeoDB.ST_Area";
CREATE ALIAS ST_AsEWKB FOR "geodb.GeoDB.ST_AsEWKB";
CREATE ALIAS ST_AsEWKT FOR "geodb.GeoDB.ST_AsEWKT";
CREATE ALIAS ST_AsHexEWKB FOR "geodb.GeoDB.ST_AsHexEWKB";
CREATE ALIAS ST_AsText FOR "geodb.GeoDB.ST_AsText";
CREATE ALIAS ST_BBOX FOR "geodb.GeoDB.ST_BBox";
CREATE ALIAS ST_Buffer FOR "geodb.GeoDB.ST_Buffer";
CREATE ALIAS ST_Centroid FOR "geodb.GeoDB.ST_Centroid";
CREATE ALIAS ST_Crosses FOR "geodb.GeoDB.ST_Crosses";
CREATE ALIAS ST_Contains FOR "geodb.GeoDB.ST_Contains";
CREATE ALIAS ST_DWithin FOR "geodb.GeoDB.ST_DWithin";
CREATE ALIAS ST_Disjoint FOR "geodb.GeoDB.ST_Disjoint";
CREATE ALIAS ST_Envelope FOR "geodb.GeoDB.ST_Envelope";
CREATE ALIAS ST_Equals FOR "geodb.GeoDB.ST_Equals";
CREATE ALIAS ST_GeoHash FOR "geodb.GeoDB.ST_GeoHash";
CREATE ALIAS ST_GeomFromEWKB FOR "geodb.GeoDB.ST_GeomFromEWKB";
CREATE ALIAS ST_GeomFromEWKT FOR "geodb.GeoDB.ST_GeomFromEWKT";
CREATE ALIAS ST_GeomFromText FOR "geodb.GeoDB.ST_GeomFromText";
CREATE ALIAS ST_GeomFromWKB FOR "geodb.GeoDB.ST_GeomFromWKB";
CREATE ALIAS ST_Intersects FOR "geodb.GeoDB.ST_Intersects";
CREATE ALIAS ST_IsEmpty FOR "geodb.GeoDB.ST_IsEmpty";
CREATE ALIAS ST_IsSimple FOR "geodb.GeoDB.ST_IsSimple";
CREATE ALIAS ST_IsValid FOR "geodb.GeoDB.ST_IsValid";
CREATE ALIAS ST_MakeBox2D FOR "geodb.GeoDB.ST_MakeBox2D";
CREATE ALIAS ST_Overlaps FOR "geodb.GeoDB.ST_Overlaps";
CREATE ALIAS ST_SRID FOR "geodb.GeoDB.ST_SRID";
CREATE ALIAS ST_SetSRID FOR "geodb.GeoDB.ST_SetSRID";
CREATE ALIAS ST_Simplify FOR "geodb.GeoDB.ST_Simplify";
CREATE ALIAS ST_Touches FOR "geodb.GeoDB.ST_Touches";
CREATE ALIAS ST_Within FOR "geodb.GeoDB.ST_Within";

Cheers,

Jan

On 6-11-2012 21:13, Leo Amigood wrote:

> Jan,
>
> Thank you for your reply.
>
> Your suggestion helped, but now i am facing other issue (similar):
>
> Caused by: org.h2.jdbc.JdbcSQLException: F*unction "GEOMFROMTEXT" not
> found*; SQL statement
>
> Do i need to have any of the H2 spatial extension (listed in
> https://groups.google.com/forum/?fromgroups=#!topic/h2-database/pN1AYaIJfZ8 
> <https://groups.google.com/forum/?fromgroups=#%21topic/h2-database/pN1AYaIJfZ8>
> )
>
> Leo
>
>
> Best 'G' regards,
> Leo Amigood
>
>
> On Tue, Nov 6, 2012 at 2:18 PM, Jan Boonen <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     Hi Leo,
>
>     H2 uses GeoDB for its spatial extension (see:
>     https://github.com/jdeolive/geodb for details). Because of this
>     construct geometry data is stored in blob fields. So to use
>     spatial functions, you'd create your table as follows:
>
>
>     CREATE TABLE location (
>       ...
>       center_geo blob NOT NULL
>       ...
>     )
>
>     If you whish your DDL files to be compatible with MySQL, you can
>     create domains:
>
>     CREATE DOMAIN point AS BLOB;
>
>     Cheers,
>
>     Jan
>
>
>     On 6-11-2012 18:37, Leo Amigood wrote:
>
>         Hi!
>
>         I am trying to get spatial h2 to work (i was able to get Mysql
>         version to work without any problems).
>
>         Somehow h2 does not recognize geometry:
>         Caused by: org.h2.jdbc.JdbcSQLException: Unknown data type:
>         "POINT"; SQL statement:
>
>         CREATE TABLE `location` (
>         ...
>           `center_geo` point NOT NULL,
>         ...
>           SPATIAL KEY `center_geo` (`center_geo`)
>         ) [50004-166])
>                 at
>         org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1549)
>                 at
>         org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388)
>                 at
>         org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
>                 at
>         org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java:81)
>                 at
>         org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)
>                 ... 58 more
>         Caused by: *org.h2.jdbc.JdbcSQLException: Unknown data type:
>         "POINT"; SQL statement:*
>
>
>         Here is the spring hibernate config:
>                 <bean id="dataSource"
>         class="org.apache.commons.dbcp.BasicDataSource"
>         destroy-method="close">
>                     <property name="driverClassName"
>         value="*org.h2.Driver*"/>
>
>                     <property name="url"
>         value="jdbc:h2:mem:dot;INIT=RUNSCRIPT FROM
>         'target/test-classes/db/h2_init.sql'"/>
>                 </bean>
>                 <bean id="sessionFactory"
>         class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
>                     <property name="dataSource" ref="dataSource"/>
>                     <property name="hibernateProperties">
>                         <value>
>                             hibernate.format_sql = true
>                             hibernate.show_sql = false
>         *hibernate.dialect = org.hibernatespatial.geodb.GeoDBDialect*
>
>                             hibernate.connection.release_mode =
>         after_statement
>         hibernate.cache.use_second_level_cache = false
>                             hibernate.cache.region.factory_class =
>         net.sf.ehcache.hibernate.SingletonEhCacheRegionFactory
>                             hibernate.generate_statistics = true
>                         </value>
>                     </property>
>                 </bean>
>
>         Best 'G' regards,
>         Leo Amigood
>
>
>         _______________________________________________
>         hibernatespatial-users mailing list
>         [hidden email]
>         <mailto:[hidden email]>
>         http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users
>
>
>
>     _______________________________________________
>     hibernatespatial-users mailing list
>     [hidden email]
>     <mailto:[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


_______________________________________________
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: Missing

Leo Amigood
Jan,

Thanks again.

Now, that worked to load my data fixture 
(though i had to use CREATE ALIAS GEOMFROMTEXT FOR "geodb.GeoDB.ST_GeomFromEWKT"; )

But now i am getting error when object is read from blob as:

java.lang.ClassCastException: org.h2.jdbc.JdbcBlob cannot be cast to [B
at org.hibernatespatial.mysql.MySQLGeometryUserType.convert2JTS(MySQLGeometryUserType.java:69)
at org.hibernatespatial.AbstractDBGeometryType.nullSafeGet(AbstractDBGeometryType.java:127)
at org.hibernatespatial.GeometryUserType.nullSafeGet(GeometryUserType.java:186)
at org.hibernate.type.CustomType.nullSafeGet(CustomType.java:109)

Leo


Best 'G' regards,
Leo Amigood


On Thu, Nov 8, 2012 at 6:39 AM, Jan Boonen <[hidden email]> wrote:
Hi Leo,

For spatial functions you must also define aliases, since GeoDB uses the new guidelines for naming geospatial functions (using ST_).

Here is an example from one of my source files:

-- Create geometry datatype
CREATE DOMAIN geometry AS BLOB;
CREATE DOMAIN serial AS INT;
CREATE DOMAIN bigserial AS BIGINT;

-- Register aliases for spatial functions
CREATE ALIAS CreateSpatialIndex for "geodb.GeoDB.CreateSpatialIndex";
CREATE ALIAS DropSpatialIndex for "geodb.GeoDB.DropSpatialIndex";
CREATE ALIAS EnvelopeAsText for "geodb.GeoDB.EnvelopeAsText";
CREATE ALIAS GeometryType for "geodb.GeoDB.GeometryType";
CREATE ALIAS ST_Area FOR "geodb.GeoDB.ST_Area";
CREATE ALIAS ST_AsEWKB FOR "geodb.GeoDB.ST_AsEWKB";
CREATE ALIAS ST_AsEWKT FOR "geodb.GeoDB.ST_AsEWKT";
CREATE ALIAS ST_AsHexEWKB FOR "geodb.GeoDB.ST_AsHexEWKB";
CREATE ALIAS ST_AsText FOR "geodb.GeoDB.ST_AsText";
CREATE ALIAS ST_BBOX FOR "geodb.GeoDB.ST_BBox";
CREATE ALIAS ST_Buffer FOR "geodb.GeoDB.ST_Buffer";
CREATE ALIAS ST_Centroid FOR "geodb.GeoDB.ST_Centroid";
CREATE ALIAS ST_Crosses FOR "geodb.GeoDB.ST_Crosses";
CREATE ALIAS ST_Contains FOR "geodb.GeoDB.ST_Contains";
CREATE ALIAS ST_DWithin FOR "geodb.GeoDB.ST_DWithin";
CREATE ALIAS ST_Disjoint FOR "geodb.GeoDB.ST_Disjoint";
CREATE ALIAS ST_Envelope FOR "geodb.GeoDB.ST_Envelope";
CREATE ALIAS ST_Equals FOR "geodb.GeoDB.ST_Equals";
CREATE ALIAS ST_GeoHash FOR "geodb.GeoDB.ST_GeoHash";
CREATE ALIAS ST_GeomFromEWKB FOR "geodb.GeoDB.ST_GeomFromEWKB";
CREATE ALIAS ST_GeomFromEWKT FOR "geodb.GeoDB.ST_GeomFromEWKT";
CREATE ALIAS ST_GeomFromText FOR "geodb.GeoDB.ST_GeomFromText";
CREATE ALIAS ST_GeomFromWKB FOR "geodb.GeoDB.ST_GeomFromWKB";
CREATE ALIAS ST_Intersects FOR "geodb.GeoDB.ST_Intersects";
CREATE ALIAS ST_IsEmpty FOR "geodb.GeoDB.ST_IsEmpty";
CREATE ALIAS ST_IsSimple FOR "geodb.GeoDB.ST_IsSimple";
CREATE ALIAS ST_IsValid FOR "geodb.GeoDB.ST_IsValid";
CREATE ALIAS ST_MakeBox2D FOR "geodb.GeoDB.ST_MakeBox2D";
CREATE ALIAS ST_Overlaps FOR "geodb.GeoDB.ST_Overlaps";
CREATE ALIAS ST_SRID FOR "geodb.GeoDB.ST_SRID";
CREATE ALIAS ST_SetSRID FOR "geodb.GeoDB.ST_SetSRID";
CREATE ALIAS ST_Simplify FOR "geodb.GeoDB.ST_Simplify";
CREATE ALIAS ST_Touches FOR "geodb.GeoDB.ST_Touches";
CREATE ALIAS ST_Within FOR "geodb.GeoDB.ST_Within";

Cheers,

Jan


On 6-11-2012 21:13, Leo Amigood wrote:
Jan,

Thank you for your reply.

Your suggestion helped, but now i am facing other issue (similar):

Caused by: org.h2.jdbc.JdbcSQLException: F*unction "GEOMFROMTEXT" not found*; SQL statement

Do i need to have any of the H2 spatial extension (listed in https://groups.google.com/forum/?fromgroups=#!topic/h2-database/pN1AYaIJfZ8 <https://groups.google.com/forum/?fromgroups=#%21topic/h2-database/pN1AYaIJfZ8> )


Leo


Best 'G' regards,
Leo Amigood


On Tue, Nov 6, 2012 at 2:18 PM, Jan Boonen <[hidden email] <mailto:[hidden email]>> wrote:

    Hi Leo,

    H2 uses GeoDB for its spatial extension (see:
    https://github.com/jdeolive/geodb for details). Because of this
    construct geometry data is stored in blob fields. So to use
    spatial functions, you'd create your table as follows:


    CREATE TABLE location (
      ...
      center_geo blob NOT NULL
      ...
    )

    If you whish your DDL files to be compatible with MySQL, you can
    create domains:

    CREATE DOMAIN point AS BLOB;

    Cheers,

    Jan


    On 6-11-2012 18:37, Leo Amigood wrote:

        Hi!

        I am trying to get spatial h2 to work (i was able to get Mysql
        version to work without any problems).

        Somehow h2 does not recognize geometry:
        Caused by: org.h2.jdbc.JdbcSQLException: Unknown data type:
        "POINT"; SQL statement:

        CREATE TABLE `location` (
        ...
          `center_geo` point NOT NULL,
        ...
          SPATIAL KEY `center_geo` (`center_geo`)
        ) [50004-166])
                at
        org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1549)
                at
        org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388)
                at
        org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
                at
        org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java:81)
                at
        org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)
                ... 58 more
        Caused by: *org.h2.jdbc.JdbcSQLException: Unknown data type:
        "POINT"; SQL statement:*


        Here is the spring hibernate config:
                <bean id="dataSource"
        class="org.apache.commons.dbcp.BasicDataSource"
        destroy-method="close">
                    <property name="driverClassName"
        value="*org.h2.Driver*"/>

                    <property name="url"
        value="jdbc:h2:mem:dot;INIT=RUNSCRIPT FROM
        'target/test-classes/db/h2_init.sql'"/>
                </bean>
                <bean id="sessionFactory"
        class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
                    <property name="dataSource" ref="dataSource"/>
                    <property name="hibernateProperties">
                        <value>
                            hibernate.format_sql = true
                            hibernate.show_sql = false
        *hibernate.dialect = org.hibernatespatial.geodb.GeoDBDialect*

                            hibernate.connection.release_mode =
        after_statement
        hibernate.cache.use_second_level_cache = false
                            hibernate.cache.region.factory_class =
        net.sf.ehcache.hibernate.SingletonEhCacheRegionFactory
                            hibernate.generate_statistics = true
                        </value>
                    </property>
                </bean>

        Best 'G' regards,
        Leo Amigood


        _______________________________________________
        hibernatespatial-users mailing list
        [hidden email]
        <mailto:[hidden email]>

        http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users



    _______________________________________________
    hibernatespatial-users mailing list
    [hidden email]
    <mailto:[hidden email]>


_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|

Re: Missing

Leo Amigood
Jan,

I think i found the issue:
The problem is that wrong MySQLGeometryUserType is loaded though i use H2. 

java.lang.ClassCastException: org.h2.jdbc.JdbcBlob cannot be cast to [B
at org.hibernatespatial.mysql.MySQLGeometryUserType.convert2JTS(MySQLGeometryUserType.java:69)

this happens ONLY if  i use both hibernatespatial dependencies.

        <dependency>
            <groupId>org.hibernatespatial</groupId>
            <artifactId>hibernate-spatial-mysql</artifactId>
            <version>1.1.1</version>
        </dependency>
        <dependency>
            <groupId>org.hibernatespatial</groupId>
            <artifactId>hibernate-spatial-h2-geodb</artifactId>
            <version>1.1.1</version>
        </dependency>

I also could use 
@Type(type = "org.hibernatespatial.geodb.GeoDBGeometryUserType") 
instead of generic 
@Type(type = "org.hibernatespatial.GeometryUserType")

but that defeats the purpose of database interoperability 

It also does not work even if i specify url as "jdbc:h2:mem:dot;MODE=HSQLDB"

Any suggestions?

Leo


Best 'G' regards,
Leo Amigood


On Thu, Nov 8, 2012 at 11:23 AM, Leo Amigood <[hidden email]> wrote:
Jan,

Thanks again.

Now, that worked to load my data fixture 
(though i had to use CREATE ALIAS GEOMFROMTEXT FOR "geodb.GeoDB.ST_GeomFromEWKT"; )

But now i am getting error when object is read from blob as:

java.lang.ClassCastException: org.h2.jdbc.JdbcBlob cannot be cast to [B
at org.hibernatespatial.mysql.MySQLGeometryUserType.convert2JTS(MySQLGeometryUserType.java:69)
at org.hibernatespatial.AbstractDBGeometryType.nullSafeGet(AbstractDBGeometryType.java:127)
at org.hibernatespatial.GeometryUserType.nullSafeGet(GeometryUserType.java:186)
at org.hibernate.type.CustomType.nullSafeGet(CustomType.java:109)

Leo


Best 'G' regards,
Leo Amigood


On Thu, Nov 8, 2012 at 6:39 AM, Jan Boonen <[hidden email]> wrote:
Hi Leo,

For spatial functions you must also define aliases, since GeoDB uses the new guidelines for naming geospatial functions (using ST_).

Here is an example from one of my source files:

-- Create geometry datatype
CREATE DOMAIN geometry AS BLOB;
CREATE DOMAIN serial AS INT;
CREATE DOMAIN bigserial AS BIGINT;

-- Register aliases for spatial functions
CREATE ALIAS CreateSpatialIndex for "geodb.GeoDB.CreateSpatialIndex";
CREATE ALIAS DropSpatialIndex for "geodb.GeoDB.DropSpatialIndex";
CREATE ALIAS EnvelopeAsText for "geodb.GeoDB.EnvelopeAsText";
CREATE ALIAS GeometryType for "geodb.GeoDB.GeometryType";
CREATE ALIAS ST_Area FOR "geodb.GeoDB.ST_Area";
CREATE ALIAS ST_AsEWKB FOR "geodb.GeoDB.ST_AsEWKB";
CREATE ALIAS ST_AsEWKT FOR "geodb.GeoDB.ST_AsEWKT";
CREATE ALIAS ST_AsHexEWKB FOR "geodb.GeoDB.ST_AsHexEWKB";
CREATE ALIAS ST_AsText FOR "geodb.GeoDB.ST_AsText";
CREATE ALIAS ST_BBOX FOR "geodb.GeoDB.ST_BBox";
CREATE ALIAS ST_Buffer FOR "geodb.GeoDB.ST_Buffer";
CREATE ALIAS ST_Centroid FOR "geodb.GeoDB.ST_Centroid";
CREATE ALIAS ST_Crosses FOR "geodb.GeoDB.ST_Crosses";
CREATE ALIAS ST_Contains FOR "geodb.GeoDB.ST_Contains";
CREATE ALIAS ST_DWithin FOR "geodb.GeoDB.ST_DWithin";
CREATE ALIAS ST_Disjoint FOR "geodb.GeoDB.ST_Disjoint";
CREATE ALIAS ST_Envelope FOR "geodb.GeoDB.ST_Envelope";
CREATE ALIAS ST_Equals FOR "geodb.GeoDB.ST_Equals";
CREATE ALIAS ST_GeoHash FOR "geodb.GeoDB.ST_GeoHash";
CREATE ALIAS ST_GeomFromEWKB FOR "geodb.GeoDB.ST_GeomFromEWKB";
CREATE ALIAS ST_GeomFromEWKT FOR "geodb.GeoDB.ST_GeomFromEWKT";
CREATE ALIAS ST_GeomFromText FOR "geodb.GeoDB.ST_GeomFromText";
CREATE ALIAS ST_GeomFromWKB FOR "geodb.GeoDB.ST_GeomFromWKB";
CREATE ALIAS ST_Intersects FOR "geodb.GeoDB.ST_Intersects";
CREATE ALIAS ST_IsEmpty FOR "geodb.GeoDB.ST_IsEmpty";
CREATE ALIAS ST_IsSimple FOR "geodb.GeoDB.ST_IsSimple";
CREATE ALIAS ST_IsValid FOR "geodb.GeoDB.ST_IsValid";
CREATE ALIAS ST_MakeBox2D FOR "geodb.GeoDB.ST_MakeBox2D";
CREATE ALIAS ST_Overlaps FOR "geodb.GeoDB.ST_Overlaps";
CREATE ALIAS ST_SRID FOR "geodb.GeoDB.ST_SRID";
CREATE ALIAS ST_SetSRID FOR "geodb.GeoDB.ST_SetSRID";
CREATE ALIAS ST_Simplify FOR "geodb.GeoDB.ST_Simplify";
CREATE ALIAS ST_Touches FOR "geodb.GeoDB.ST_Touches";
CREATE ALIAS ST_Within FOR "geodb.GeoDB.ST_Within";

Cheers,

Jan


On 6-11-2012 21:13, Leo Amigood wrote:
Jan,

Thank you for your reply.

Your suggestion helped, but now i am facing other issue (similar):

Caused by: org.h2.jdbc.JdbcSQLException: F*unction "GEOMFROMTEXT" not found*; SQL statement

Do i need to have any of the H2 spatial extension (listed in https://groups.google.com/forum/?fromgroups=#!topic/h2-database/pN1AYaIJfZ8 <https://groups.google.com/forum/?fromgroups=#%21topic/h2-database/pN1AYaIJfZ8> )


Leo


Best 'G' regards,
Leo Amigood


On Tue, Nov 6, 2012 at 2:18 PM, Jan Boonen <[hidden email] <mailto:[hidden email]>> wrote:

    Hi Leo,

    H2 uses GeoDB for its spatial extension (see:
    https://github.com/jdeolive/geodb for details). Because of this
    construct geometry data is stored in blob fields. So to use
    spatial functions, you'd create your table as follows:


    CREATE TABLE location (
      ...
      center_geo blob NOT NULL
      ...
    )

    If you whish your DDL files to be compatible with MySQL, you can
    create domains:

    CREATE DOMAIN point AS BLOB;

    Cheers,

    Jan


    On 6-11-2012 18:37, Leo Amigood wrote:

        Hi!

        I am trying to get spatial h2 to work (i was able to get Mysql
        version to work without any problems).

        Somehow h2 does not recognize geometry:
        Caused by: org.h2.jdbc.JdbcSQLException: Unknown data type:
        "POINT"; SQL statement:

        CREATE TABLE `location` (
        ...
          `center_geo` point NOT NULL,
        ...
          SPATIAL KEY `center_geo` (`center_geo`)
        ) [50004-166])
                at
        org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1549)
                at
        org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388)
                at
        org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
                at
        org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java:81)
                at
        org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)
                ... 58 more
        Caused by: *org.h2.jdbc.JdbcSQLException: Unknown data type:
        "POINT"; SQL statement:*


        Here is the spring hibernate config:
                <bean id="dataSource"
        class="org.apache.commons.dbcp.BasicDataSource"
        destroy-method="close">
                    <property name="driverClassName"
        value="*org.h2.Driver*"/>

                    <property name="url"
        value="jdbc:h2:mem:dot;INIT=RUNSCRIPT FROM
        'target/test-classes/db/h2_init.sql'"/>
                </bean>
                <bean id="sessionFactory"
        class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
                    <property name="dataSource" ref="dataSource"/>
                    <property name="hibernateProperties">
                        <value>
                            hibernate.format_sql = true
                            hibernate.show_sql = false
        *hibernate.dialect = org.hibernatespatial.geodb.GeoDBDialect*

                            hibernate.connection.release_mode =
        after_statement
        hibernate.cache.use_second_level_cache = false
                            hibernate.cache.region.factory_class =
        net.sf.ehcache.hibernate.SingletonEhCacheRegionFactory
                            hibernate.generate_statistics = true
                        </value>
                    </property>
                </bean>

        Best 'G' regards,
        Leo Amigood


        _______________________________________________
        hibernatespatial-users mailing list
        [hidden email]
        <mailto:[hidden email]>

        http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users



    _______________________________________________
    hibernatespatial-users mailing list
    [hidden email]
    <mailto:[hidden email]>


_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|

Re: Missing

Leo Amigood
I found the solution: http://www.hibernatespatial.org/providers.html

But, it's just a bit confusing why hibernate-spatial does not use dialect specifies in sessionFactory as
hibernate.dialect = org.hibernatespatial.geodb.GeoDBDialect

Thank you!

Leo


Best 'G' regards,
Leo Amigood


On Thu, Nov 8, 2012 at 12:25 PM, Leo Amigood <[hidden email]> wrote:
Jan,

I think i found the issue:
The problem is that wrong MySQLGeometryUserType is loaded though i use H2. 

java.lang.ClassCastException: org.h2.jdbc.JdbcBlob cannot be cast to [B
at org.hibernatespatial.mysql.MySQLGeometryUserType.convert2JTS(MySQLGeometryUserType.java:69)

this happens ONLY if  i use both hibernatespatial dependencies.

        <dependency>
            <groupId>org.hibernatespatial</groupId>
            <artifactId>hibernate-spatial-mysql</artifactId>
            <version>1.1.1</version>
        </dependency>
        <dependency>
            <groupId>org.hibernatespatial</groupId>
            <artifactId>hibernate-spatial-h2-geodb</artifactId>
            <version>1.1.1</version>
        </dependency>

I also could use 
@Type(type = "org.hibernatespatial.geodb.GeoDBGeometryUserType") 
instead of generic 
@Type(type = "org.hibernatespatial.GeometryUserType")

but that defeats the purpose of database interoperability 

It also does not work even if i specify url as "jdbc:h2:mem:dot;MODE=HSQLDB"

Any suggestions?

Leo


Best 'G' regards,
Leo Amigood


On Thu, Nov 8, 2012 at 11:23 AM, Leo Amigood <[hidden email]> wrote:
Jan,

Thanks again.

Now, that worked to load my data fixture 
(though i had to use CREATE ALIAS GEOMFROMTEXT FOR "geodb.GeoDB.ST_GeomFromEWKT"; )

But now i am getting error when object is read from blob as:

java.lang.ClassCastException: org.h2.jdbc.JdbcBlob cannot be cast to [B
at org.hibernatespatial.mysql.MySQLGeometryUserType.convert2JTS(MySQLGeometryUserType.java:69)
at org.hibernatespatial.AbstractDBGeometryType.nullSafeGet(AbstractDBGeometryType.java:127)
at org.hibernatespatial.GeometryUserType.nullSafeGet(GeometryUserType.java:186)
at org.hibernate.type.CustomType.nullSafeGet(CustomType.java:109)

Leo


Best 'G' regards,
Leo Amigood


On Thu, Nov 8, 2012 at 6:39 AM, Jan Boonen <[hidden email]> wrote:
Hi Leo,

For spatial functions you must also define aliases, since GeoDB uses the new guidelines for naming geospatial functions (using ST_).

Here is an example from one of my source files:

-- Create geometry datatype
CREATE DOMAIN geometry AS BLOB;
CREATE DOMAIN serial AS INT;
CREATE DOMAIN bigserial AS BIGINT;

-- Register aliases for spatial functions
CREATE ALIAS CreateSpatialIndex for "geodb.GeoDB.CreateSpatialIndex";
CREATE ALIAS DropSpatialIndex for "geodb.GeoDB.DropSpatialIndex";
CREATE ALIAS EnvelopeAsText for "geodb.GeoDB.EnvelopeAsText";
CREATE ALIAS GeometryType for "geodb.GeoDB.GeometryType";
CREATE ALIAS ST_Area FOR "geodb.GeoDB.ST_Area";
CREATE ALIAS ST_AsEWKB FOR "geodb.GeoDB.ST_AsEWKB";
CREATE ALIAS ST_AsEWKT FOR "geodb.GeoDB.ST_AsEWKT";
CREATE ALIAS ST_AsHexEWKB FOR "geodb.GeoDB.ST_AsHexEWKB";
CREATE ALIAS ST_AsText FOR "geodb.GeoDB.ST_AsText";
CREATE ALIAS ST_BBOX FOR "geodb.GeoDB.ST_BBox";
CREATE ALIAS ST_Buffer FOR "geodb.GeoDB.ST_Buffer";
CREATE ALIAS ST_Centroid FOR "geodb.GeoDB.ST_Centroid";
CREATE ALIAS ST_Crosses FOR "geodb.GeoDB.ST_Crosses";
CREATE ALIAS ST_Contains FOR "geodb.GeoDB.ST_Contains";
CREATE ALIAS ST_DWithin FOR "geodb.GeoDB.ST_DWithin";
CREATE ALIAS ST_Disjoint FOR "geodb.GeoDB.ST_Disjoint";
CREATE ALIAS ST_Envelope FOR "geodb.GeoDB.ST_Envelope";
CREATE ALIAS ST_Equals FOR "geodb.GeoDB.ST_Equals";
CREATE ALIAS ST_GeoHash FOR "geodb.GeoDB.ST_GeoHash";
CREATE ALIAS ST_GeomFromEWKB FOR "geodb.GeoDB.ST_GeomFromEWKB";
CREATE ALIAS ST_GeomFromEWKT FOR "geodb.GeoDB.ST_GeomFromEWKT";
CREATE ALIAS ST_GeomFromText FOR "geodb.GeoDB.ST_GeomFromText";
CREATE ALIAS ST_GeomFromWKB FOR "geodb.GeoDB.ST_GeomFromWKB";
CREATE ALIAS ST_Intersects FOR "geodb.GeoDB.ST_Intersects";
CREATE ALIAS ST_IsEmpty FOR "geodb.GeoDB.ST_IsEmpty";
CREATE ALIAS ST_IsSimple FOR "geodb.GeoDB.ST_IsSimple";
CREATE ALIAS ST_IsValid FOR "geodb.GeoDB.ST_IsValid";
CREATE ALIAS ST_MakeBox2D FOR "geodb.GeoDB.ST_MakeBox2D";
CREATE ALIAS ST_Overlaps FOR "geodb.GeoDB.ST_Overlaps";
CREATE ALIAS ST_SRID FOR "geodb.GeoDB.ST_SRID";
CREATE ALIAS ST_SetSRID FOR "geodb.GeoDB.ST_SetSRID";
CREATE ALIAS ST_Simplify FOR "geodb.GeoDB.ST_Simplify";
CREATE ALIAS ST_Touches FOR "geodb.GeoDB.ST_Touches";
CREATE ALIAS ST_Within FOR "geodb.GeoDB.ST_Within";

Cheers,

Jan


On 6-11-2012 21:13, Leo Amigood wrote:
Jan,

Thank you for your reply.

Your suggestion helped, but now i am facing other issue (similar):

Caused by: org.h2.jdbc.JdbcSQLException: F*unction "GEOMFROMTEXT" not found*; SQL statement

Do i need to have any of the H2 spatial extension (listed in https://groups.google.com/forum/?fromgroups=#!topic/h2-database/pN1AYaIJfZ8 <https://groups.google.com/forum/?fromgroups=#%21topic/h2-database/pN1AYaIJfZ8> )


Leo


Best 'G' regards,
Leo Amigood


On Tue, Nov 6, 2012 at 2:18 PM, Jan Boonen <[hidden email] <mailto:[hidden email]>> wrote:

    Hi Leo,

    H2 uses GeoDB for its spatial extension (see:
    https://github.com/jdeolive/geodb for details). Because of this
    construct geometry data is stored in blob fields. So to use
    spatial functions, you'd create your table as follows:


    CREATE TABLE location (
      ...
      center_geo blob NOT NULL
      ...
    )

    If you whish your DDL files to be compatible with MySQL, you can
    create domains:

    CREATE DOMAIN point AS BLOB;

    Cheers,

    Jan


    On 6-11-2012 18:37, Leo Amigood wrote:

        Hi!

        I am trying to get spatial h2 to work (i was able to get Mysql
        version to work without any problems).

        Somehow h2 does not recognize geometry:
        Caused by: org.h2.jdbc.JdbcSQLException: Unknown data type:
        "POINT"; SQL statement:

        CREATE TABLE `location` (
        ...
          `center_geo` point NOT NULL,
        ...
          SPATIAL KEY `center_geo` (`center_geo`)
        ) [50004-166])
                at
        org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1549)
                at
        org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388)
                at
        org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
                at
        org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.java:81)
                at
        org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)
                ... 58 more
        Caused by: *org.h2.jdbc.JdbcSQLException: Unknown data type:
        "POINT"; SQL statement:*


        Here is the spring hibernate config:
                <bean id="dataSource"
        class="org.apache.commons.dbcp.BasicDataSource"
        destroy-method="close">
                    <property name="driverClassName"
        value="*org.h2.Driver*"/>

                    <property name="url"
        value="jdbc:h2:mem:dot;INIT=RUNSCRIPT FROM
        'target/test-classes/db/h2_init.sql'"/>
                </bean>
                <bean id="sessionFactory"
        class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
                    <property name="dataSource" ref="dataSource"/>
                    <property name="hibernateProperties">
                        <value>
                            hibernate.format_sql = true
                            hibernate.show_sql = false
        *hibernate.dialect = org.hibernatespatial.geodb.GeoDBDialect*

                            hibernate.connection.release_mode =
        after_statement
        hibernate.cache.use_second_level_cache = false
                            hibernate.cache.region.factory_class =
        net.sf.ehcache.hibernate.SingletonEhCacheRegionFactory
                            hibernate.generate_statistics = true
                        </value>
                    </property>
                </bean>

        Best 'G' regards,
        Leo Amigood


        _______________________________________________
        hibernatespatial-users mailing list
        [hidden email]
        <mailto:[hidden email]>

        http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users



    _______________________________________________
    hibernatespatial-users mailing list
    [hidden email]
    <mailto:[hidden email]>


_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|

Re: Missing

Karel Maesen
Administrator
The reason is that in Hibernate 3 there is no good way for Hibernate Spatial to look-up the dialect in the SessionFactory.

In any case, this is no longer a problem in Hibernate 4 or later.

Regards,

Karel Maesen


On 08 Nov 2012, at 21:02, Leo Amigood wrote:

> But, it's just a bit confusing why hibernate-spatial does not use dialect specifies in sessionFactory as
> hibernate.dialect = org.hibernatespatial.geodb.GeoDBDialect
>

_______________________________________________
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: Missing

Leo Amigood
Karel,

Thank you for your reply.

I followed your suggestion and upgraded to hibernate 4. Everything works as expected, though i had to explicitly load postgis-jdbc version 1.5.2 due to version 1.5.3 being not available in http://www.hibernatespatial.org/repository 

        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-spatial</artifactId>
            <version>4.0-M1</version>
            <exclusions>
                <exclusion>
                    <artifactId>postgis-jdbc</artifactId>
                    <groupId>org.postgis</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.postgis</groupId>
            <artifactId>postgis-jdbc</artifactId>
            <version>1.5.2</version>
            <scope>compile</scope>
        </dependency>

Am i missing something?

Leo


Best 'G' regards,
Leo Amigood


On Fri, Nov 9, 2012 at 3:59 PM, Karel Maesen <[hidden email]> wrote:
The reason is that in Hibernate 3 there is no good way for Hibernate Spatial to look-up the dialect in the SessionFactory.

In any case, this is no longer a problem in Hibernate 4 or later.

Regards,

Karel Maesen


On 08 Nov 2012, at 21:02, Leo Amigood wrote:

> But, it's just a bit confusing why hibernate-spatial does not use dialect specifies in sessionFactory as
> hibernate.dialect = org.hibernatespatial.geodb.GeoDBDialect
>

_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|

Re: Missing

Karel Maesen
Administrator
Hi Leo,

Postgis JDBC is not systematically released into public repositories. Apparently 1.5.3 was in my local repo, but not in any public ones. So, no you didn't miss anything, and there is no problem using version 1.5.2.

Regards,

Karel

On 11 Nov 2012, at 02:28, Leo Amigood wrote:

> Karel,
>
> Thank you for your reply.
>
> I followed your suggestion and upgraded to hibernate 4. Everything works as expected, though i had to explicitly load postgis-jdbc version 1.5.2 due to version 1.5.3 being not available in http://www.hibernatespatial.org/repository 
>
>         <dependency>
>             <groupId>org.hibernate</groupId>
>             <artifactId>hibernate-spatial</artifactId>
>             <version>4.0-M1</version>
>             <exclusions>
>                 <exclusion>
>                     <artifactId>postgis-jdbc</artifactId>
>                     <groupId>org.postgis</groupId>
>                 </exclusion>
>             </exclusions>
>         </dependency>
>         <dependency>
>             <groupId>org.postgis</groupId>
>             <artifactId>postgis-jdbc</artifactId>
>             <version>1.5.2</version>
>             <scope>compile</scope>
>         </dependency>
>
> Am i missing something?
>
> Leo
>
>
> Best 'G' regards,
> Leo Amigood
>
>
> On Fri, Nov 9, 2012 at 3:59 PM, Karel Maesen <[hidden email]> wrote:
> The reason is that in Hibernate 3 there is no good way for Hibernate Spatial to look-up the dialect in the SessionFactory.
>
> In any case, this is no longer a problem in Hibernate 4 or later.
>
> Regards,
>
> Karel Maesen
>
>
> On 08 Nov 2012, at 21:02, Leo Amigood wrote:
>
> > But, it's just a bit confusing why hibernate-spatial does not use dialect specifies in sessionFactory as
> > hibernate.dialect = org.hibernatespatial.geodb.GeoDBDialect
> >
>
> _______________________________________________
> 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

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