-->
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: ID Property Setter
PostPosted: Sun Aug 28, 2005 8:35 pm 
Newbie

Joined: Tue Jun 14, 2005 10:01 am
Posts: 3
Location: Berlin, Germany / Oslo, Norway
Hello,

do IDs as set by such mapping code

Code:
<id name="ID" column="ID" type="Int32">
   <generator class="assigned" />
</id>


require a setter method?

I'm wondering because I've seen working code which only has a getter method for the ID, whilst my own program does not run without a setter.

Any info would be highly appreciated.

Regards,
Marvin


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 30, 2005 10:42 am 
Contributor
Contributor

Joined: Thu May 12, 2005 9:45 am
Posts: 593
Location: nhibernate.org
"assigned" means that your application is responsible to assign the ID before the entity is saved...
So you don't need a setter as long as there is a way to set the ID (either in the constructor or in another method...)

_________________
Pierre Henri Kuaté.
Get NHibernate in Action Now!


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 20, 2005 10:13 pm 
Newbie

Joined: Sun Nov 20, 2005 10:23 am
Posts: 19
Hi Pierre,

I'm just with this problem, I don't imagine because the nhibernate it would have exige the property setter method to a class that in mapping file your generator is "assigned". I change (setter of Id property) the User class of QuickStart and it don't work, just because the change. I don't understand, because this?

Thank's..

[]'s
FernandoVM


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 21, 2005 8:27 am 
Contributor
Contributor

Joined: Thu May 12, 2005 9:45 am
Posts: 593
Location: nhibernate.org
What did you changed?

Can you post your mapping and the code you are executing?

_________________
Pierre Henri Kuaté.
Get NHibernate in Action Now!


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.