-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Problem with <generator class="native"/> ver
PostPosted: Tue Aug 17, 2004 12:35 am 
Beginner
Beginner

Joined: Tue May 11, 2004 10:21 am
Posts: 20
Problem seems to be with Ant 1.6 and Hibernate 2.1.6 when I try to create a schema in the part where <generator class="native"/>. It doesn't have to be native, what else can I substitute?



Hibernate version: 2.1.6

Mapping documents:
<hibernate-mapping>
<class name="com.oreilly.hh.Album" table="ALBUM">
<meta attribute="class-description">
Represents an album in the music database, an organized list of tracks.
@author Jim Elliott (with help from Hibernate)
</meta>

<id name="id" type="int" column="ALBUM_ID">
<meta attribute="scope-set">protected</meta>
<generator class="native"/>
</id>

<property name="title" type="string">
<meta attribute="use-in-tostring">true</meta>
<column name="TITLE" not-null="true" index="ALBUM_TITLE"/>
</property>

<property name="numDiscs" type="integer"/>

<set name="artists" table="ALBUM_ARTISTS">
<key column="ALBUM_ID"/>
<many-to-many class="com.oreilly.hh.Artist" column="ARTIST_ID"/>
</set>

<set name="comments" table="ALBUM_COMMENTS">
<key column="ALBUM_ID"/>
<element column="COMMENT" type="string"/>
</set>

<list name="tracks" table="ALBUM_TRACKS" cascade="all">
<meta attribute="use-in-tostring">true</meta>
<key column="ALBUM_ID"/>
<index column="POS"/>
<composite-element class="com.oreilly.hh.AlbumTrack">
<many-to-one name="track" class="com.oreilly.hh.Track" cascade="all">
<meta attribute="use-in-tostring">true</meta>
<column name="TRACK_ID"/>
</many-to-one>
<property name="disc" type="integer"/>
<property name="positionOnDisc" type="integer"/>
</composite-element>
</list>

<property name="added" type="date">
<meta attribute="field-description">When the album was created</meta>
</property>

</class>
</hibernate-mapping>

Full stack trace of any exception that occurs:

[schemaexport] DEBUG [main] (SchemaExport.java:149) - create table ALBUM (
[schemaexport] ALBUM_ID integer generated by default as identity (start with 1),
[schemaexport] TITLE varchar(255) not null,
[schemaexport] numDiscs integer,
[schemaexport] added date
[schemaexport] )
[schemaexport] ERROR [main] (SchemaExport.java:154) - Unsuccessful: create table ALBUM (AL
BUM_ID integer generated by default as identity (start with 1), TITLE varchar(255) not nul
l, numDiscs integer, added date)

Name and version of the database you are using:
MySQL 4.017


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 17, 2004 12:38 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Use MySQLDialect instead of HSQLDialect


Top
 Profile  
 
 Post subject: Ooops I meant to say using Hypersonic database
PostPosted: Tue Aug 17, 2004 2:42 am 
Beginner
Beginner

Joined: Tue May 11, 2004 10:21 am
Posts: 20
I posted that I was using Mysql. For this test I am using Hypersonic hsqldb_1_7_2_3. I have a work around for the problem, that being:
changing <generator class="native"/> to <generator class="hilo"/>

Why it stopped working when I upgraded to Hibernate 2.1.6, I don't know, but when I put the old 2.1.5 Hibernate in there it works, generating the schema.

Thanks.

Tom K.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 17, 2004 4:23 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Double check and if it is still the case then create a Jira entry (with a small example thats shows the problem).


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.