Hi, from what I understood from the NH manual, I guess that is what I am looking for:
<property name="Descricao" type="String" column="descricao" access="nosetter.camelcase-underscore"/> With nosetter, field _descricao is used when reading from Database and property Descricao(get) is used to get data from the object. Thanks On Thu, Mar 12, 2009 at 6:17 PM, TigerShark <[email protected]>wrote: > > Uhm, might I suggest you take a look at the documentation, especially > the part about access strategies (http://www.hibernate.org/hib_docs/ > nhibernate/1.2/reference/en/html/mapping.html#mapping-declaration-<http://www.hibernate.org/hib_docs/%0Anhibernate/1.2/reference/en/html/mapping.html#mapping-declaration-> > mapping)... > > I believe what you are looking for is access="nosetter.camelcase- > undescore" or "field.camelcase-underscore" > > LINQ-to-NH is based on the mapping files, so how you access your > objects has nothing to do with LINQ. > > On 12 Mar., 19:23, Humberto Marchezi <[email protected]> wrote: > > Hi community, > > > > That is the solution I was looking for maybe it could be interesting for > you > > too. > > > > Now I can save objects with field accessor in order to avoid trouble when > > reading. > > At the same time I can use the get property in order to let me to make > use > > of Linq-to-NHibernate. > > > > See the mapping for a Name property and _name field in the class Person: > > > > * <-- NHibernate can use _name for writing -->* > > <property name="_name" type="String" column="name" not-null="true" > > access="field"/> > > > > * <-- Name property (get) is not used for inserts or updates but for > > Linq-to-NHibernate -->* > > <property name="Name" type="String" column="name" insert="false" > > update="false" access="property"/> > > > > On Thu, Mar 12, 2009 at 10:48 AM, Humberto Marchezi < > [email protected]>wrote: > > > > > > > > > Maybe *MUCH *more faster depending on what code is injected in these > > > properties. > > > However I still don´t know if Linq-to-NHibernate works with field > accessor > > > mappings. > > > I guess I should check it myself. > > > > > On Thu, Mar 12, 2009 at 8:47 AM, Dario Quintana < > > > [email protected]> wrote: > > > > >> And a little bit faster > > > > >> On Thu, Mar 12, 2009 at 9:43 AM, Humberto Marchezi < > [email protected]>wrote: > > > > >>> So would you say that field accessor is better practice than property > > >>> accessor ? > > > > >> -- > > >> Dario Quintana > > >>http://darioquintana.com.ar > > > > > -- > > > Humberto C Marchezi > > > --------------------------------------------------------- > > > Master in Electrical Engineering - Automation > > > Software Consultant and Developer > > > at the Town Hall of Vitória > > > > -- > > Humberto C Marchezi > > --------------------------------------------------------- > > Master in Electrical Engineering - Automation > > Software Consultant and Developer > > at the Town Hall of Vitória > > > -- Humberto C Marchezi --------------------------------------------------------- Master in Electrical Engineering - Automation Software Consultant and Developer at the Town Hall of Vitória --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nhusers?hl=en -~----------~----~----~----~------~----~------~--~---
