-->
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: No setter found for property
PostPosted: Mon Jun 25, 2007 4:39 am 
Newbie

Joined: Mon Jun 25, 2007 4:19 am
Posts: 8
Hi,
Suppose I have a get property of an Employee. When I try to map that, NHibernate framework says that a setter is needed.
Is it possible to map a get property?
Thank you.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 25, 2007 5:24 am 
Regular
Regular

Joined: Tue Aug 08, 2006 4:28 am
Posts: 96
Location: Hong Kong
In this case, you have to provide an access strategy to tell NHibernate how to get and set the property value. The "nosetter" access strategy looks like the one you need. Depending on the naming convention you are using, you may need to specify the naming strategy as well. What you actually need is
Code:
<property ... access="access-strategy.naming-strategy" />


Related information can be found in NHiberanate Documentation at http://www.hibernate.org/hib_docs/nhibernate/1.2/reference/en/html/mapping.html#mapping-declaration-property. Table 5.1 and 5.2 tell you the access and naming strategy respectively.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 25, 2007 5:36 am 
Newbie

Joined: Mon Jun 25, 2007 4:19 am
Posts: 8
Thank you for that perfect answer.


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.