problems with generating schema with hibernate spatial

8 Messages Forum Options Options
Embed this topic
Permalink
Coquelicot-2
problems with generating schema with hibernate spatial
Reply Threaded More
Print post
Permalink
Hi Andy,

I was using org.hibernatespatial.oracle.OracleSpatial10gDialect. I
have a confirmation of this when I run Ant in debug mode.

Are you also running Ant to generate the schemas? Which options are
you passing to the task? I pass only 'hibernate.properties', not the
XML configuration file.

cheers,

--
Lukasz


===============================

Hi,

Can you actually confirm what you are setting hibnerate.dialect to ? It
should be either org.hibernatespatial.postgis.PostgisDialect or
org.hibernatespatial.oracle.OracleSpatial10gDialect.  Although I only used
the hbm2ddl task to create a very simple schema, it did it correctly under
both Oracle and Postgis/Postgres.

Cheers,

Andy
_______________________________________________
hibernatespatial-users mailing list
hibernatespatial-users@...
http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users
andydale
Re: problems with generating schema with hibernate spatial
Reply Threaded More
Print post
Permalink
Hi Lukasz,

I did not use the hibernate.properties with ant for building the schema (ort ant at all).  I programmatically created a EJB3Configuration with a hibernate.cfg.xml, this seemed to work well.

Cheers,

Andy

2008/6/11 Coquelicot <coquelicot408@...>:
Hi Andy,

I was using org.hibernatespatial.oracle.OracleSpatial10gDialect. I
have a confirmation of this when I run Ant in debug mode.

Are you also running Ant to generate the schemas? Which options are
you passing to the task? I pass only 'hibernate.properties', not the
XML configuration file.

cheers,

--
Lukasz


===============================

Hi,

Can you actually confirm what you are setting hibnerate.dialect to ? It
should be either org.hibernatespatial.postgis.PostgisDialect or
org.hibernatespatial.oracle.OracleSpatial10gDialect.  Although I only used
the hbm2ddl task to create a very simple schema, it did it correctly under
both Oracle and Postgis/Postgres.

Cheers,

Andy


_______________________________________________
hibernatespatial-users mailing list
hibernatespatial-users@...
http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users
Karel Maesen
Re: problems with generating schema with hibernate spatial
Reply Threaded More
Print post
Permalink
In reply to this post by Coquelicot-2
Can you verify that the Hibernate spatial oracle provider jar is on  
the classpath? It looks like the spatial extension bootstrap class  
can't locate any providers.

Regards,

Karel

On 11 Jun 2008, at 12:08, Coquelicot wrote:

> Hi Andy,
>
> I was using org.hibernatespatial.oracle.OracleSpatial10gDialect. I
> have a confirmation of this when I run Ant in debug mode.
>
> Are you also running Ant to generate the schemas? Which options are
> you passing to the task? I pass only 'hibernate.properties', not the
> XML configuration file.
>
> cheers,
>
> --
> Lukasz
>
>
> ===============================
>
> Hi,
>
> Can you actually confirm what you are setting hibnerate.dialect  
> to ? It
> should be either org.hibernatespatial.postgis.PostgisDialect or
> org.hibernatespatial.oracle.OracleSpatial10gDialect.  Although I  
> only used
> the hbm2ddl task to create a very simple schema, it did it  
> correctly under
> both Oracle and Postgis/Postgres.
>
> Cheers,
>
> Andy
> _______________________________________________
> hibernatespatial-users mailing list
> hibernatespatial-users@...
> http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/ 
> hibernatespatial-users

_______________________________________________
hibernatespatial-users mailing list
hibernatespatial-users@...
http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users
Coquelicot-2
Re: problems with generating schema with hibernate spatial
Reply Threaded More
Print post
Permalink
In reply to this post by andydale
Karel,

I think this is an Ant problem. When I run 'ant -lib <set of libraries
needed for hibernate spatial> <my schema gen target>' I generate the
schema; when I run 'ant <my schema gen target>' I'm getting the same
error as before. Now, I'm pretty sure that I'm including all needed
JARs in target definition in ant file but for some reason, this JARs
are not passed to the target. Now I'm trying to overcome this
problem... maybe claspath is wrong at the momen od declaration of
Hibernate expoert schema target? to resolve this, one solution could
be to run somehow ant from _within_ ant build file with CLASSPATH
explicitly set to one with which all works... I'm curious if anyone
had the similar problem.

But, when I examined the generated schema, it seems that the schema
generated by Hibernate's export schema tool is not complete? I have
declared one column as Polygon and this column in SQL schema is being
declared as of type 'geometry'... shouldn't it be something more like
'MDSYS.SDO_GEOMETRY' and then this to initialize spatial module:

INSERT INTO USER_SDO_GEOM_METADATA
  VALUES (
  '<table name>',
  '<column name>',
  MDSYS.SDO_DIM_ARRAY(
    MDSYS.SDO_DIM_ELEMENT('Longitude', -180, 180, 10),  -- 10 meters tolerance
    MDSYS.SDO_DIM_ELEMENT('Latitude', -90, 90, 10)  -- 10 meters tolerance
     ),
  8307   -- SRID for ''Longitude / Latitude (WGS 84)' coordinate system
);


> Can you verify that the Hibernate spatial oracle provider jar is on
> the classpath? It looks like the spatial extension bootstrap class
> can't locate any providers.
>
> Regards,
>
> Karel
>
> On 11 Jun 2008, at 12:08, Coquelicot wrote:
>
>> Hi Andy,
>>
>> I was using org.hibernatespatial.oracle.OracleSpatial10gDialect. I
>> have a confirmation of this when I run Ant in debug mode.
>>
>> Are you also running Ant to generate the schemas? Which options are
>> you passing to the task? I pass only 'hibernate.properties', not the
>> XML configuration file.
>>
>> cheers,
>>
>> --
>> Lukasz
>>
>>
>> ===============================
>>
>> Hi,
>>
>> Can you actually confirm what you are setting hibnerate.dialect
>> to ? It
>> should be either org.hibernatespatial.postgis.PostgisDialect or
>> org.hibernatespatial.oracle.OracleSpatial10gDialect.  Although I
>> only used
>> the hbm2ddl task to create a very simple schema, it did it
>> correctly under
>> both Oracle and Postgis/Postgres.
>>
>> Cheers,
>>
>> Andy
>> _______________________________________________
>> hibernatespatial-users mailing list
>> hibernatespatial-users@...
>> http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/
>> hibernatespatial-users
>
>
>
> ------------------------------
>
> _______________________________________________
> hibernatespatial-users mailing list
> hibernatespatial-users@...
> http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users
>
>
> End of hibernatespatial-users Digest, Vol 10, Issue 4
> *****************************************************
>



--
Lukasz
_______________________________________________
hibernatespatial-users mailing list
hibernatespatial-users@...
http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users
Karel Maesen
Re: problems with generating schema with hibernate spatial
Reply Threaded More
Print post
Permalink
Hi,

On 12 Jun 2008, at 15:01, Coquelicot wrote:
> But, when I examined the generated schema, it seems that the schema
> generated by Hibernate's export schema tool is not complete? I have
> declared one column as Polygon and this column in SQL schema is being
> declared as of type 'geometry'... shouldn't it be something more like
> 'MDSYS.SDO_GEOMETRY'


That's a bug in the milestone release version. In the version in svn  
trunk it is corrected.


> and then this to initialize spatial module:
>
> INSERT INTO USER_SDO_GEOM_METADATA
>   VALUES (
>   '<table name>',
>   '<column name>',
>   MDSYS.SDO_DIM_ARRAY(
>     MDSYS.SDO_DIM_ELEMENT('Longitude', -180, 180, 10),  -- 10  
> meters tolerance
>     MDSYS.SDO_DIM_ELEMENT('Latitude', -90, 90, 10)  -- 10 meters  
> tolerance
>      ),
>   8307   -- SRID for ''Longitude / Latitude (WGS 84)' coordinate  
> system
> );

It should, but that is not implemented yet.


Regards,

Karel


_______________________________________________
hibernatespatial-users mailing list
hibernatespatial-users@...
http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users
Coquelicot-2
Re: problems with generating schema with hibernate spatial
Reply Threaded More
Print post
Permalink
In reply to this post by Coquelicot-2
Karl,

thanks for the tip! I have compiled the version from the repository
and now schema generates OK. As I am generating my Java/Hibernate
mappings automatically, I can also generate proper SQL code to
initialize Oracle spatial.

BTW: this questiom is little off-topic but - is there an easy
way/tutrial how to use JTS with actual longitude/lattitude? I am a
real beginner to JTS and I have noticed that it handles Geo data more
generic than lat/lon... or am I wrong?

thanks, greetings

> Date: Fri, 13 Jun 2008 15:29:18 +0200
> From: Karel Maesen <karel@...>
> Subject: Re: [hibernatespatial-users] problems with generating schema
hibernatespatial-users@...

> http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users
>
>
> End>        with    hibernate spatial
> To: Hibernate Spatial Users Discussion
>        <hibernatespatial-users@...>
> Message-ID: <BB06BA93-85A5-470C-9E68-384C25DADA7F@...>
> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
>
> Hi,
>
> On 12 Jun 2008, at 15:01, Coquelicot wrote:
>> But, when I examined the generated schema, it seems that the schema
>> generated by Hibernate's export schema tool is not complete? I have
>> declared one column as Polygon and this column in SQL schema is being
>> declared as of type 'geometry'... shouldn't it be something more like
>> 'MDSYS.SDO_GEOMETRY'
>
>
> That's a bug in the milestone release version. In the version in svn
> trunk it is corrected.
>
>
>> and then this to initialize spatial module:
>>
>> INSERT INTO USER_SDO_GEOM_METADATA
>>   VALUES (
>>   '<table name>',
>>   '<column name>',
>>   MDSYS.SDO_DIM_ARRAY(
>>     MDSYS.SDO_DIM_ELEMENT('Longitude', -180, 180, 10),  -- 10
>> meters tolerance
>>     MDSYS.SDO_DIM_ELEMENT('Latitude', -90, 90, 10)  -- 10 meters
>> tolerance
>>      ),
>>   8307   -- SRID for ''Longitude / Latitude (WGS 84)' coordinate
>> system
>> );
>
> It should, but that is not implemented yet.
>
>
> Regards,
>
> Karel
>

--
Lukasz
_______________________________________________
hibernatespatial-users mailing list
hibernatespatial-users@...
http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users
Coquelicot-2
Re: problems with generating schema with hibernate spatial
Reply Threaded More
Print post
Permalink
Karel, all,

I have solved my problem with schema generation. Instead of using Ant
task as defined in hibernate documentation, I used <java> task to run
the class itself. It works like a charm :).



--
Lukasz
_______________________________________________
hibernatespatial-users mailing list
hibernatespatial-users@...
http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users
{-}
Re: problems with generating schema with hibernate spatial
Reply Threaded More
Print post
Permalink
My problem was that I was using both javax annotations and hbm.xml files, after only using annotations with also org.hibernate.type anno, worked fine. at least in deploying.
thanks all

2008/6/20 Coquelicot <coquelicot408@...>:
Karel, all,

I have solved my problem with schema generation. Instead of using Ant
task as defined in hibernate documentation, I used <java> task to run
the class itself. It works like a charm :).



--
Lukasz
_______________________________________________
hibernatespatial-users mailing list
hibernatespatial-users@...
http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users


_______________________________________________
hibernatespatial-users mailing list
hibernatespatial-users@...
http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users