问答数据库字典.dbo 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <zhiqim-dbo>
  3. <config version="1.2.0" dbType="postgresql" folder="../test" initDataWidth="820">
  4. <![CDATA[
  5. /*
  6. * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙,邂逅框架梦]
  7. *
  8. * 知启蒙数据库映射(zhiqim_orm)在LGPL3.0协议下开源:https://www.zhiqim.com/gitcan/zhiqim/zhiqim_orm.htm
  9. *
  10. * This file is part of [zhiqim_orm].
  11. *
  12. * [zhiqim_orm] is free software: you can redistribute
  13. * it and/or modify it under the terms of the GNU Lesser General Public License
  14. * as published by the Free Software Foundation, either version 3 of the
  15. * License, or (at your option) any later version.
  16. *
  17. * [zhiqim_orm] is distributed in the hope that it will
  18. * be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. * GNU Lesser General Public License for more details.
  21. *
  22. * You should have received a copy of the GNU Lesser General Public License
  23. * along with [zhiqim_orm].
  24. * If not, see <http://www.gnu.org/licenses/>.
  25. */
  26. ]]>
  27. </config>
  28. <package name="org.zhiqim.orm.test.qc.dbo" type="true" desc="问答定义表">
  29. <table name="QC_QUESTION$ID$" desc="问答问题表" key="QUESTION_ID" type="InnoDB">
  30. <field column="QUESTION_ID" type="long" length="" notNull="true" desc="问题编号"/>
  31. <field column="QUESTION_TYPE" type="int" length="" notNull="true" desc="问题类型: 0技术疑问 1职业疑惑 2生活杂谈 3资讯动态 4其他"/>
  32. <field column="QUESTION_STATUS" type="int" length="" notNull="true" desc="问题状态:0表示正常,1表示停用"/>
  33. <field column="QUESTION_TITLE" type="string" length="100" notNull="true" desc="问题标题"/>
  34. <field column="QUESTION_DESC" type="string" length="4000" notNull="true" desc="问题描述"/>
  35. <field column="QUESTION_USER_ID" type="long" length="" notNull="true" desc="问题作者编号"/>
  36. <field column="QUESTION_CREATE_TIME" type="string" length="19,char" notNull="true" desc="问题发表时间"/>
  37. <field column="QUESTION_REPLY_NUM" type="int" length="" notNull="true" desc="问题评论数"/>
  38. <field column="QUESTION_READ_NUM" type="int" length="" notNull="true" desc="问题阅读数"/>
  39. </table>
  40. <table name="QC_COMMENT" desc="问答评论表" key="QUESTION_ID,COMMENT_ID" type="InnoDB">
  41. <field column="QUESTION_ID" type="long" length="" notNull="true" desc="问题编号"/>
  42. <field column="COMMENT_ID" type="long" length="" notNull="true" desc="评论编号"/>
  43. <field column="COMMENT_CONTENT" type="string" length="4000" notNull="true" desc="评论内容"/>
  44. <field column="COMMENT_USER_ID" type="long" length="" notNull="true" desc="评论作者编号"/>
  45. <field column="COMMENT_GOOD_NUM" type="int" length="" notNull="true" desc="点赞数"/>
  46. <field column="COMMENT_CREATE_TIME" type="string" length="19,char" notNull="true" desc="评论发表时间"/>
  47. </table>
  48. <table name="QC_ANSWER" desc="回复表" key="COMMENT_ID,ANSWER_ID" type="InnoDB">
  49. <field column="QUESTION_ID" type="long" length="" notNull="true" desc="问题编号"/>
  50. <field column="COMMENT_ID" type="long" length="" notNull="true" desc="评论编号"/>
  51. <field column="ANSWER_ID" type="long" length="" notNull="true" desc="回复编号"/>
  52. <field column="COMMENT_USER_ID" type="long" length="" notNull="true" desc="评论作者编号"/>
  53. <field column="ANSWER_CONTENT" type="string" length="2000" notNull="true" desc="回复内容"/>
  54. <field column="ANSWER_USER_ID" type="long" length="" notNull="true" desc="回复作者编号"/>
  55. <field column="ANSWER_TIME" type="string" length="19,char" notNull="true" desc="回复时间"/>
  56. </table>
  57. <table name="QC_GOOD" desc="点赞表" key="COMMENT_ID,GOOD_USER_ID" type="InnoDB">
  58. <field column="COMMENT_ID" type="long" length="" notNull="true" desc="评论编号"/>
  59. <field column="GOOD_USER_ID" type="long" length="" notNull="true" desc="点赞人编号"/>
  60. </table>
  61. <table name="USER_ACCOUNT" desc="用户表" key="USER_ID" type="InnoDB">
  62. <field column="USER_ID" type="long" length="" notNull="true" desc="用户编号"/>
  63. <field column="USER_NICK" type="string" length="32" notNull="false" desc="用户昵称"/>
  64. <field column="USER_AVATAR_50" type="string" length="200" notNull="false" desc="用户头像"/>
  65. </table>
  66. </package>
  67. <package name="org.zhiqim.orm.test.qc.ex" type="true" desc="问答扩展表">
  68. <view name="QUESTION_EX" type="true" desc="问题扩展表" table="QC_QUESTION$ID$,USER_ACCOUNT">
  69. <join type="EQUAL" lTable="QC_QUESTION$ID$" lColumn="QUESTION_USER_ID" rTable="USER_ACCOUNT" rColumn="USER_ID"/>
  70. <field column="USER_NICK" table="USER_ACCOUNT"/>
  71. <field column="USER_AVATAR_50" table="USER_ACCOUNT"/>
  72. <field column="*" table="QC_QUESTION$ID$"/>
  73. </view>
  74. <view name="COMMENT_EX" type="true" desc="评论扩展表" table="QC_COMMENT,USER_ACCOUNT">
  75. <join type="EQUAL" lTable="QC_COMMENT" lColumn="COMMENT_USER_ID" rTable="USER_ACCOUNT" rColumn="USER_ID"/>
  76. <field column="USER_NICK" table="USER_ACCOUNT"/>
  77. <field column="USER_AVATAR_50" table="USER_ACCOUNT"/>
  78. <field column="*" table="QC_COMMENT"/>
  79. </view>
  80. <view name="ANSWER_EX" type="true" desc="回复扩展表" table="QC_ANSWER,USER_ACCOUNT a,USER_ACCOUNT b">
  81. <join type="EQUAL" lTable="QC_ANSWER" lColumn="ANSWER_USER_ID" rTable="a" rColumn="USER_ID"/>
  82. <join type="LEFT" lTable="QC_ANSWER" lColumn="COMMENT_USER_ID" rTable="b" rColumn="USER_ID"/>
  83. <field column="USER_NICK ANSWER_USER_NICK" table="a"/>
  84. <field column="USER_AVATAR_50 ANSWER_USER_AVATAR_50" table="a"/>
  85. <field column="USER_NICK COMMENT_USER_NICK" table="b"/>
  86. <field column="USER_AVATAR_50 COMMENT_USER_AVATAR_50" table="b"/>
  87. <field column="*" table="QC_ANSWER"/>
  88. </view>
  89. </package>
  90. </zhiqim-dbo>