Meal.hbm.xml 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE hibernate-mapping
  3. PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
  4. <hibernate-mapping auto-import="false" default-cascade="all-delete-orphan" default-lazy="false">
  5. <class discriminator-value="[magoffin.matt.ieat.domain.Meal]"
  6. name="magoffin.matt.ieat.domain.Meal"
  7. table="meal">
  8. <cache usage="read-write"/>
  9. <id access="org.jvnet.hyperjaxb2.runtime.hibernate.accessor.CheckingPropertyAccessor"
  10. name="MealId"
  11. type="org.hibernate.type.LongType"
  12. unsaved-value="null">
  13. <column name="mealid" not-null="true"/>
  14. <generator class="native"/>
  15. </id>
  16. <discriminator formula="'magoffin.matt.ieat.domain.Meal'" type="org.hibernate.type.StringType"/>
  17. <many-to-one cascade="none" class="magoffin.matt.ieat.domain.User"
  18. foreign-key="meal_user_fk"
  19. insert="true"
  20. name="Owner"
  21. update="false">
  22. <column name="ownerid"/>
  23. </many-to-one>
  24. <list access="org.jvnet.hyperjaxb2.runtime.hibernate.accessor.ListAccessor"
  25. lazy="false"
  26. name="Recipe"
  27. table="Meal_Recipe">
  28. <cache usage="read-write"/>
  29. <key foreign-key="mealrecipe_meal_fk">
  30. <column name="mealid"/>
  31. </key>
  32. <list-index>
  33. <column name="pos"/>
  34. </list-index>
  35. <one-to-many class="magoffin.matt.ieat.domain.MealRecipe"/>
  36. </list>
  37. <property access="org.jvnet.hyperjaxb2.runtime.hibernate.accessor.CheckingPropertyAccessor"
  38. name="Name">
  39. <column length="128" name="meal_name" not-null="true"/>
  40. <type name="org.hibernate.type.StringType"/>
  41. </property>
  42. <subclass discriminator-value="magoffin.matt.ieat.domain.Meal"
  43. name="magoffin.matt.ieat.domain.impl.MealImpl"/>
  44. </class>
  45. </hibernate-mapping>