TaskModel.hbm.xml 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
  3. assembly="TaskDatabase" default-lazy="false"
  4. namespace="TaskDatabase.Model">
  5. <!-- more mapping info here -->
  6. <class name="TaskModel" table="task" entity-name="TaskModel">
  7. <id name="Tid">
  8. <!--<generator class="guid" />-->
  9. <generator class="native" />
  10. <!-- <generator class="native" />主键自增。使用数据库自带的生成器 -->
  11. </id>
  12. <property name="Id" />
  13. <property name="Task_name"/>
  14. <property name="Task_cmd" update="false" />
  15. <property name="Task_param" update="false"/>
  16. <property name="Task_status"/>
  17. <property name="Task_result_json" />
  18. <property name="Task_expected_finish_time" update="false"/>
  19. <property name="Task_add_time" insert="false" update="false"/>
  20. <set name="DownloadTaskModelList">
  21. <key column="Task_id" property-ref="Id"/>
  22. <one-to-many class="DownloadTaskModel"/>
  23. </set>
  24. </class>
  25. <class name="DownloadTaskModel" table="download">
  26. <id name="Tid">
  27. <!--<generator class="guid" />-->
  28. <generator class="native" />
  29. <!-- <generator class="native" />主键自增。使用数据库自带的生成器 -->
  30. </id>
  31. <property name="Id" />
  32. <property name="Task_id" >
  33. <!--<many-to-one class="DownloadTaskModel" column="Task_Id"/>-->
  34. </property>
  35. <property name="Task_url" />
  36. <property name="Task_md5" />
  37. <property name="Local_dir" />
  38. <property name="Downloaded_bytes" />
  39. <property name="File_bytes" />
  40. <property name="Finish_time" />
  41. </class>
  42. </hibernate-mapping>