Recipe.hbm.xml 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  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.Recipe]"
  6. name="magoffin.matt.ieat.domain.Recipe"
  7. table="recipe">
  8. <cache usage="read-write"/>
  9. <id access="org.jvnet.hyperjaxb2.runtime.hibernate.accessor.CheckingPropertyAccessor"
  10. name="RecipeId"
  11. type="org.hibernate.type.LongType"
  12. unsaved-value="null">
  13. <column name="recipeid" not-null="true"/>
  14. <generator class="native"/>
  15. </id>
  16. <discriminator formula="'magoffin.matt.ieat.domain.Recipe'"
  17. type="org.hibernate.type.StringType"/>
  18. <list access="org.jvnet.hyperjaxb2.runtime.hibernate.accessor.ListAccessor"
  19. lazy="false"
  20. name="Comment"
  21. table="Recipe_Comment_">
  22. <cache usage="read-write"/>
  23. <key foreign-key="recipecomment_recipe_fk">
  24. <column name="recipeid"/>
  25. </key>
  26. <list-index>
  27. <column name="pos"/>
  28. </list-index>
  29. <one-to-many class="magoffin.matt.ieat.domain.RecipeComment"/>
  30. </list>
  31. <many-to-one cascade="none" class="magoffin.matt.ieat.domain.User"
  32. foreign-key="recipe_user_fk"
  33. insert="true"
  34. name="Owner"
  35. update="false">
  36. <column name="ownerid"/>
  37. </many-to-one>
  38. <property access="org.jvnet.hyperjaxb2.runtime.hibernate.accessor.CheckingPropertyAccessor"
  39. name="Directions">
  40. <column name="directions"/>
  41. <type name="text"/>
  42. </property>
  43. <many-to-one cascade="none" class="magoffin.matt.ieat.domain.Difficulty"
  44. foreign-key="recipe_difficulty_fk"
  45. insert="true"
  46. name="Difficulty"
  47. update="true">
  48. <column name="difficultyid"/>
  49. </many-to-one>
  50. <list access="org.jvnet.hyperjaxb2.runtime.hibernate.accessor.ListAccessor"
  51. lazy="false"
  52. name="Rating"
  53. table="Recipe_Rating">
  54. <cache usage="read-write"/>
  55. <key foreign-key="reciperating_recipe_fk">
  56. <column name="recipeid"/>
  57. </key>
  58. <list-index>
  59. <column name="pos"/>
  60. </list-index>
  61. <one-to-many class="magoffin.matt.ieat.domain.RecipeRating"/>
  62. </list>
  63. <list access="org.jvnet.hyperjaxb2.runtime.hibernate.accessor.ListAccessor"
  64. lazy="false"
  65. name="RelatedRecipe"
  66. table="Recipe_RelatedRecipe">
  67. <cache usage="read-write"/>
  68. <key foreign-key="relatedrecipe_recipe_fk">
  69. <column name="recipeid"/>
  70. </key>
  71. <list-index>
  72. <column name="pos"/>
  73. </list-index>
  74. <one-to-many class="magoffin.matt.ieat.domain.RelatedRecipe"/>
  75. </list>
  76. <list access="org.jvnet.hyperjaxb2.runtime.hibernate.accessor.ListAccessor"
  77. lazy="false"
  78. name="Step"
  79. table="Recipe_Step">
  80. <cache usage="read-write"/>
  81. <key foreign-key="recipestep_recipe_fk">
  82. <column name="recipeid"/>
  83. </key>
  84. <list-index>
  85. <column name="pos"/>
  86. </list-index>
  87. <one-to-many class="magoffin.matt.ieat.domain.RecipeStep"/>
  88. </list>
  89. <property access="org.jvnet.hyperjaxb2.runtime.hibernate.accessor.CheckingPropertyAccessor"
  90. name="ModifiedDate">
  91. <column name="modifieddate"/>
  92. <type name="org.jvnet.hyperjaxb2.runtime.hibernate.type.CalendarType"/>
  93. </property>
  94. <property access="org.jvnet.hyperjaxb2.runtime.hibernate.accessor.CheckingPropertyAccessor"
  95. name="Image">
  96. <column length="255" name="image"/>
  97. <type name="org.hibernate.type.StringType"/>
  98. </property>
  99. <property access="org.jvnet.hyperjaxb2.runtime.hibernate.accessor.CheckingPropertyAccessor"
  100. name="Source">
  101. <column length="128" name="source"/>
  102. <type name="org.hibernate.type.StringType"/>
  103. </property>
  104. <many-to-one cascade="none" class="magoffin.matt.ieat.domain.Base"
  105. foreign-key="recipe_base_fk"
  106. insert="true"
  107. name="Base"
  108. update="true">
  109. <column name="baseid"/>
  110. </many-to-one>
  111. <many-to-one cascade="none" class="magoffin.matt.ieat.domain.System"
  112. foreign-key="recipe_system_fk"
  113. insert="true"
  114. name="System"
  115. update="true">
  116. <column name="systemid"/>
  117. </many-to-one>
  118. <property access="org.jvnet.hyperjaxb2.runtime.hibernate.accessor.CheckingPropertyAccessor"
  119. name="Name">
  120. <column length="128" name="recipe_name" not-null="true"/>
  121. <type name="org.hibernate.type.StringType"/>
  122. </property>
  123. <many-to-one cascade="none" class="magoffin.matt.ieat.domain.Ethnicity"
  124. foreign-key="recipe_ethnicity_fk"
  125. insert="true"
  126. name="Ethnicity"
  127. update="true">
  128. <column name="ethnicityid"/>
  129. </many-to-one>
  130. <property access="org.jvnet.hyperjaxb2.runtime.hibernate.accessor.CheckingPropertyAccessor"
  131. name="ServingSize">
  132. <column name="servingsize" not-null="true"/>
  133. <type name="org.hibernate.type.IntegerType"/>
  134. </property>
  135. <many-to-one cascade="none" class="magoffin.matt.ieat.domain.PrepTime"
  136. foreign-key="recipe_preptime_fk"
  137. insert="true"
  138. name="PrepTime"
  139. update="true">
  140. <column name="preptimeid"/>
  141. </many-to-one>
  142. <list access="org.jvnet.hyperjaxb2.runtime.hibernate.accessor.ListAccessor"
  143. lazy="false"
  144. name="Ingredient"
  145. table="Recipe_Ingredient">
  146. <cache usage="read-write"/>
  147. <key foreign-key="recipeingredient_recipe_fk">
  148. <column name="recipeid"/>
  149. </key>
  150. <list-index>
  151. <column name="pos"/>
  152. </list-index>
  153. <one-to-many class="magoffin.matt.ieat.domain.RecipeIngredient"/>
  154. </list>
  155. <property access="org.jvnet.hyperjaxb2.runtime.hibernate.accessor.CheckingPropertyAccessor"
  156. name="Excerpt">
  157. <column name="excerpt"/>
  158. <type name="text"/>
  159. </property>
  160. <property access="org.jvnet.hyperjaxb2.runtime.hibernate.accessor.CheckingPropertyAccessor"
  161. name="CreatedDate">
  162. <column name="createddate"/>
  163. <type name="org.jvnet.hyperjaxb2.runtime.hibernate.type.CalendarType"/>
  164. </property>
  165. <many-to-one cascade="none" class="magoffin.matt.ieat.domain.Course"
  166. foreign-key="recipe_course_fk"
  167. insert="true"
  168. name="Course"
  169. update="true">
  170. <column name="courseid"/>
  171. </many-to-one>
  172. <subclass discriminator-value="magoffin.matt.ieat.domain.Recipe"
  173. name="magoffin.matt.ieat.domain.impl.RecipeImpl"/>
  174. </class>
  175. </hibernate-mapping>