code_junkie

NHibernate Mapping intermediary table

Nov 13th, 2011
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. public class UserVO
  2. {
  3. public virtual int id { get; set; }
  4. public virtual string name { get; set; }
  5. public virtual string pass { get; set; }
  6. public virtual string email { get; set; }
  7. public virtual string level { get; set; }
  8. public virtual List<LocalCalendarGroupVO> localCalendarGroups { get; set; }
  9. }
  10. public class LocalCalendarGroupVO
  11. {
  12.  
  13. public virtual int id { get; set; }
  14. public virtual string name { get; set; }
  15.  
  16. }
  17.  
  18. <class name="UserVO" table="tb_users" lazy="false">
  19.  
  20. <id name="id" column="id">
  21.  
  22. <generator class="native" />
  23.  
  24. </id>
  25.  
  26. <property name="name" />
  27. <property name="pass" />
  28. <property name="level" />
  29. <property name="email" />
  30. <property name="localCalendarGroups"/>
  31.  
  32. <class name="UserVO" table="tb_users">
  33. <id name="id" column="id">
  34. <generator class="native" />
  35. </id>
  36. <property name="name" />
  37. <property name="pass" />
  38. <property name="level" />
  39. <property name="email" />
  40.  
  41. <bag name="localCalendarGroups" table="user_localCalendarGroup">
  42. <key column="userID" />
  43. <many-to-many class="LocalCalendarGroupVO" column="calID" />
  44. </bag>
  45. </class>
  46.  
  47. public class UserVO
  48. {
  49. public virtual int id { get; set; }
  50. public virtual string name { get; set; }
  51. public virtual string pass { get; set; }
  52. public virtual string email { get; set; }
  53. public virtual string level { get; set; }
  54. public virtual IList<LocalCalendarGroupVO> localCalendarGroups { get; set; }
  55. }
Add Comment
Please, Sign In to add comment