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.  [ 8 posts ] 
Author Message
 Post subject: using existing generator
PostPosted: Mon Aug 30, 2004 6:04 am 
Newbie

Joined: Mon Aug 16, 2004 3:49 am
Posts: 9
Location: Austria
hi, i want to use a generator, that allready exists in my database. i defined the id in the maping document as sequence:




Code:
    <id
        name="personNo"
        type="int"
        column="PERSON_NO"
    >
        <generator class="sequence">
            <param name="sequence">GEN_PERSON_ID</param>
        </generator>
    </id>


but everytime I start my project, hibernate tries to generate exactly this generator (but it cannot because I am using Firebird, I know the problems with metadata-update).

Code:
ERROR - Unsuccessful: create generator GEN_PERSON_ID
ERROR - GDS Exception. 335544351. unsuccessful metadata update
DEFINE GENERATOR failed


why does Hibernate cannot find the existing generator "GEN_PERSON_ID" and wants to create a new one? did I make a mistake?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 30, 2004 6:18 am 
Regular
Regular

Joined: Thu Aug 05, 2004 2:27 am
Posts: 54
Location: South Africa
I think what you're looking for is "native"


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 30, 2004 6:41 am 
Newbie

Joined: Thu May 06, 2004 4:25 pm
Posts: 13
Location: Prague, Czech Republic
I'm also using Firebird 1.5 and I've got no problems with sequences. I've got for example this mapping.
Code:
      <id name="id" type="integer" column="ID" >
         <generator class="sequence">
            <param name="sequence">G_BLOCK_ID</param>
         </generator>
      </id>


Are you using the correct dialect (FirebidDialect or InterbaseDialect)?
Pavel


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 30, 2004 8:45 am 
Newbie

Joined: Mon Aug 16, 2004 3:49 am
Posts: 9
Location: Austria
hi garyfisher,

there is no difference between my example and yours. the dialect I am using is correct. hibernate runs without any problem (when i insert an object the generator will be called), but each time I start the application the error posted above is displayed. There is no problem in using the sequence, but the error doesn't look very fine;)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 30, 2004 9:07 am 
Regular
Regular

Joined: Wed Aug 18, 2004 5:16 am
Posts: 69
Location: Modena, Italy
The difference is the type attribute but I dont know if this matter


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 30, 2004 9:29 am 
Regular
Regular

Joined: Thu Aug 05, 2004 2:27 am
Posts: 54
Location: South Africa
tq wrote:
I think what you're looking for is "native"


sorry about that, I didn't read properly


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 30, 2004 10:30 am 
Newbie

Joined: Mon Aug 16, 2004 3:49 am
Posts: 9
Location: Austria
Teg wrote:
The difference is the type attribute but I dont know if this matter


the result (or the error) is the same when i replace "int" with "integer".


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 01, 2004 3:45 am 
Newbie

Joined: Mon Aug 16, 2004 3:49 am
Posts: 9
Location: Austria
*push*

has nobody an idee how to avoid this errors?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 8 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.