code_junkie

NHibernate: How can I combine fields from two classes?

Nov 12th, 2011
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. <class name="Person">
  2.  
  3. <id name="Id" column="person_id" unsaved-value="0">
  4.  
  5. <generator class="native"/>
  6.  
  7. </id>
  8.  
  9.  
  10.  
  11. <property name="Name"/>
  12.  
  13. <property name="Sex"/>
  14.  
  15.  
  16.  
  17. <join table="address">
  18.  
  19. <key column="address_id"/>
  20.  
  21. <property name="Address"/>
  22.  
  23. <property name="Zip"/>
  24.  
  25. <property name="Country"/>
  26.  
  27. <property name="HomePhone"/>
  28.  
  29. <property name="BusinessPhone"/>
  30.  
  31. </join>
  32.  
  33. </class>
  34.  
  35. public class Image {
  36. public virtual HostingProvider HostingProvider { get; set; } // NHibernate takes care of this
  37. public virtual string BaseUrl { get { return HostingProvider.BaseUrl; } }
  38. }
Add Comment
Please, Sign In to add comment