Hibernate XML Mapping


/ Published in: XML
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <?xml version="1.0"?>
  2. <!DOCTYPE hibernate-mapping PUBLIC
  3. "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
  4. "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
  5.  
  6. <hibernate-mapping package="eg">
  7.  
  8. <class
  9. name="Blog"
  10. table="BLOGS">
  11.  
  12. <id
  13. name="id"
  14. column="BLOG_ID">
  15.  
  16. <generator class="native"/>
  17.  
  18. </id>
  19.  
  20. <property
  21. name="name"
  22. column="NAME"
  23. not-null="true"
  24. unique="true"/>
  25.  
  26. <bag
  27. name="items"
  28. inverse="true"
  29. order-by="DATE_TIME"
  30. cascade="all">
  31.  
  32. <key column="BLOG_ID"/>
  33. <one-to-many class="BlogItem"/>
  34.  
  35. </bag>
  36.  
  37. </class>
  38.  
  39. </hibernate-mapping>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.