-->
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: c# 3.0 properties
PostPosted: Thu Jul 31, 2008 5:20 pm 
Newbie

Joined: Thu Jun 14, 2007 3:46 am
Posts: 17
Has NHibernate support to map property like this:

public int Id { get; private set; }

using no-setter but is there also an naming stategy for? or must i make the fields then?


Top
 Profile  
 
 Post subject: Re: c# 3.0 properties
PostPosted: Fri Aug 01, 2008 5:29 am 
Regular
Regular

Joined: Mon Aug 29, 2005 3:07 pm
Posts: 77
DaveSmits wrote:
Has NHibernate support to map property like this:

public int Id { get; private set; }

using no-setter but is there also an naming stategy for? or must i make the fields then?
As to my knowledge, NHibernate supports this out of the box.
You have a property with a getter and a setter. The setter is private, but, nonetheless, there's a setter, so NHibernate can access this.
You don't have to specify a naming strategy. Moreover, you're not possible since you have no knowledge on how the field will be named.
You can map this field very simply:
Code:
<property name = "Id' column="IdColumn" />


But, why didn't you try it first ? :)


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.