-->
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.  [ 2 posts ] 
Author Message
 Post subject: simple question : auto_increment fields
PostPosted: Tue May 18, 2004 11:56 am 
Newbie

Joined: Thu Apr 29, 2004 11:40 am
Posts: 7
Hi,

just a simple beginner question, but I do not seem to find it in the
docs (or maybe I'm too tired and reading over it every time after
trying the last 24hrs to get hibernate working (still failing btw, so
no sleep for me yet)).

The Q is:
after you do save/saveOrUpdate, is a newly generated record's
key retrieved into the pojo?

for instance:
table:
my_id: integer auto_increment pk
my_value: varchar(50)

when you do new:
myTable mt = new myTable();
mt.setMyValue('ZZZZzzzzzzzz');
sess.flush();
sess.save(mt);
tx.commit();

would the value that is set in my_id by the database then be
accessible in the mt object, or is it not retrieved?

thnx,
Dimitri Smits


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 18, 2004 12:18 pm 
Regular
Regular

Joined: Tue Oct 07, 2003 10:20 am
Posts: 77
It's accessible from the POJO after the save.


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