-->
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.  [ 3 posts ] 
Author Message
 Post subject: setting unsaved-value with middlegen/hibernate plugin?
PostPosted: Wed Dec 17, 2003 5:04 pm 
Newbie

Joined: Fri Dec 12, 2003 1:27 pm
Posts: 10
In using middlegen/hibernate plugin to generate .hbm.xml files, can the "unsaved-value" for an id field be set either through the GUI or in the perfs files? (Or in some other automated way so as to avoid adding it manually to each of the .hbm.xml's?)

IOW, I would like the plugin to generate this:

<id
name="actionId"
type="int"
column="action_id"
unsaved-value="0"
>
.....
</id>

By default unsaved-value is omitted.

Thanks,
Steve


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 17, 2003 8:33 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
At the moment no. The unsaved value is being generated depending on the type of id generator selected. This is on the TODO list.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 18, 2003 10:44 am 
Newbie

Joined: Fri Dec 12, 2003 1:27 pm
Posts: 10
David,

Thanks for the fast reply.

I'm using a postgres db with sequences. I understand that I can either use "native" or "sequence" as the id generator. Am I correct in saying that neither of these will generate "unsaved-value=0"?

I'm guessing that unsaved-value defaults to "null", so when I run hbm2java it assumes I'm using an object type for an id and my primitive "ints" are therefore converted to java Integer classes.

Is there a work around for this so that int id's be generated as ints?

Steve


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