Posted By

Uzbekjon on 10/03/08


Tagged

java xml mapping Hibernate


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

Tyster


Hibernate XML Mapping


 / Published in: XML
 

  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  

You need to login to post a comment.