-->
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: Get id after save
PostPosted: Sat Apr 29, 2006 4:52 pm 
Newbie

Joined: Sat Apr 29, 2006 4:47 pm
Posts: 2
Location: Stockholm
Hi, im having a bit of a problem. When I save my objects the Identityproperty of my class is not updated, how do I fix this.

Dummycode:

Foo foo = new Foo();
foo.Property = "asd";

session.Save(foo);

Response.Write(foo.Id);

It outputs: 0


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 29, 2006 5:19 pm 
Senior
Senior

Joined: Wed Jun 15, 2005 4:17 am
Posts: 156
post the mapping file

cheers,
radu


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 29, 2006 5:29 pm 
Newbie

Joined: Sat Apr 29, 2006 4:47 pm
Posts: 2
Location: Stockholm
Realized it was because I used assigned instead of native in the generator field :| (New to nhibernate)


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.