-->
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.  [ 1 post ] 
Author Message
 Post subject: NHibernate mapping and RIA services
PostPosted: Mon Aug 02, 2010 2:43 am 
Regular
Regular

Joined: Fri Feb 18, 2005 3:34 am
Posts: 88
Location: Poland/Wrocław
Hi all,

I want to have component element in my mapping file and I want the property being behind it to be accessible by a RIA services client (a Silverlight client in my case). The mapping looks like this:

Code:
   <class name="Customer" table="`CRM_CUSTOMER`">
      <id name="ID">
         <generator class="native" />
      </id>
      <property name="Symbol" unique="true" />
      <property name="Name" />
      <property name="FirstName" />
      <property name="LastName" />
      <property name="NIP" />
      <component name="Address" class="Address">
         <property name="Descriptive" />
         <property name="Street" />
         <property name="City" />
         <property name="PostCode" />
         <property name="Country" />
      </component>
   </class>


and the Customer class is as this:

Code:
   public class Customer
   {
      [Key]
      public virtual int ID { get; set; }

      public virtual string Symbol { get; set; }

      public virtual string Name { get; set; }

      public virtual string FirstName { get; set; }

      public virtual string LastName { get; set; }

      public virtual string NIP { get; set; }

      public virtual Address Address { get; set; }
   }


The KetAttribute attribute is required for the RIA services. All works just fine but not the Address property does not. It is not accessible on the client side because code generators (in VS 2010) did not produce any property in the client-side Customer class...

The question is how do I make such mapping working with RIA services. I would really like to have an address consistent in a separate object instead of flat properties in the Customer class.

Thank you in advance.

_________________
Please rate this post if you've found it helpfull
Roland


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.