GenTable.java 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540
  1. package com.boman.gen.domain;
  2. import java.util.List;
  3. import javax.validation.Valid;
  4. import javax.validation.constraints.NotBlank;
  5. import org.apache.commons.lang3.ArrayUtils;
  6. import com.boman.common.core.constant.GenConstants;
  7. import com.boman.common.core.utils.StringUtils;
  8. import com.boman.common.core.web.domain.BaseEntity;
  9. /**
  10. * 业务表 gen_table
  11. *
  12. * @author ruoyi
  13. */
  14. public class GenTable extends BaseEntity
  15. {
  16. private static final long serialVersionUID = 1L;
  17. /** 编号 */
  18. private Long tableId;
  19. /** 表名称 */
  20. @NotBlank(message = "表名称不能为空")
  21. private String tableName;
  22. /** 表描述 */
  23. @NotBlank(message = "表描述不能为空")
  24. private String tableComment;
  25. /** 关联父表的表名 */
  26. private String subTableName;
  27. /** 本表关联父表的外键名 */
  28. private String subTableFkName;
  29. /** 实体类名称(首字母大写) */
  30. @NotBlank(message = "实体类名称不能为空")
  31. private String className;
  32. /** 使用的模板(crud单表操作 tree树表操作 sub主子表操作) */
  33. private String tplCategory;
  34. /** 生成包路径 */
  35. @NotBlank(message = "生成包路径不能为空")
  36. private String packageName;
  37. /** 生成模块名 */
  38. @NotBlank(message = "生成模块名不能为空")
  39. private String moduleName;
  40. /** 生成业务名 */
  41. @NotBlank(message = "生成业务名不能为空")
  42. private String businessName;
  43. /** 生成功能名 */
  44. @NotBlank(message = "生成功能名不能为空")
  45. private String functionName;
  46. /** 生成作者 */
  47. @NotBlank(message = "作者不能为空")
  48. private String functionAuthor;
  49. /** 生成代码方式(0zip压缩包 1自定义路径) */
  50. private String genType;
  51. /** 生成路径(不填默认项目路径) */
  52. private String genPath;
  53. /** 主键信息 */
  54. private GenTableColumn pkColumn;
  55. /** 子表信息 */
  56. private GenTable subTable;
  57. /** 表列信息 */
  58. @Valid
  59. private List<GenTableColumn> columns;
  60. /** 主表关联的附表信息(附表包含字段信息) */
  61. @Valid
  62. private List<GenTable> relationList;
  63. /** 其它生成选项 */
  64. private String options;
  65. /**
  66. * 是否菜单
  67. */
  68. private String isMenu;
  69. /**
  70. * 菜单权限(AMDQSUE)
  71. */
  72. @NotBlank(message = "菜单权限不能为空")
  73. private String menuRole;
  74. /**
  75. * 输入字段
  76. */
  77. private Long akColumn;
  78. /**
  79. * 输出字段
  80. */
  81. private Long dkColumn;
  82. /**
  83. * 新增触发器
  84. */
  85. private String triggerCreate;
  86. /**
  87. * 检索触发器
  88. */
  89. private String triggerRetrieve;
  90. /**
  91. * 修改触发器
  92. */
  93. private String triggerUpdate;
  94. /**
  95. * 删除触发器
  96. */
  97. private String triggerDelete;
  98. /**
  99. * 提交触发器
  100. */
  101. private String triggerSubmit;
  102. /**
  103. * 实际数据库名称
  104. */
  105. private String realTableName;
  106. /**
  107. * 过滤条件
  108. */
  109. private String filterConditions;
  110. /**
  111. * 扩展属性
  112. */
  113. private String extendedAttributes;
  114. /** 树编码字段 */
  115. private String treeCode;
  116. /** 树父编码字段 */
  117. private String treeParentCode;
  118. /** 树名称字段 */
  119. private String treeName;
  120. /** 上级菜单ID字段 */
  121. private String parentMenuId;
  122. /** 上级菜单名称字段 */
  123. private String parentMenuName;
  124. public String getRealTableName() {
  125. return realTableName;
  126. }
  127. public void setRealTableName(String realTableName) {
  128. this.realTableName = realTableName;
  129. }
  130. public String getFilterConditions() {
  131. return filterConditions;
  132. }
  133. public void setFilterConditions(String filterConditions) {
  134. this.filterConditions = filterConditions;
  135. }
  136. public String getExtendedAttributes() {
  137. return extendedAttributes;
  138. }
  139. public void setExtendedAttributes(String extendedAttributes) {
  140. this.extendedAttributes = extendedAttributes;
  141. }
  142. public String getTriggerCreate() {
  143. return triggerCreate;
  144. }
  145. public void setTriggerCreate(String triggerCreate) {
  146. this.triggerCreate = triggerCreate;
  147. }
  148. public String getTriggerRetrieve() {
  149. return triggerRetrieve;
  150. }
  151. public void setTriggerRetrieve(String triggerRetrieve) {
  152. this.triggerRetrieve = triggerRetrieve;
  153. }
  154. public String getTriggerUpdate() {
  155. return triggerUpdate;
  156. }
  157. public void setTriggerUpdate(String triggerUpdate) {
  158. this.triggerUpdate = triggerUpdate;
  159. }
  160. public String getTriggerDelete() {
  161. return triggerDelete;
  162. }
  163. public void setTriggerDelete(String triggerDelete) {
  164. this.triggerDelete = triggerDelete;
  165. }
  166. public String getTriggerSubmit() {
  167. return triggerSubmit;
  168. }
  169. public void setTriggerSubmit(String triggerSubmit) {
  170. this.triggerSubmit = triggerSubmit;
  171. }
  172. public Long getAkColumn() {
  173. return akColumn;
  174. }
  175. public void setAkColumn(Long akColumn) {
  176. this.akColumn = akColumn;
  177. }
  178. public Long getDkColumn() {
  179. return dkColumn;
  180. }
  181. public void setDkColumn(Long dkColumn) {
  182. this.dkColumn = dkColumn;
  183. }
  184. public String getIsMenu() {
  185. return isMenu;
  186. }
  187. public void setIsMenu(String isMenu) {
  188. this.isMenu = isMenu;
  189. }
  190. public String getMenuRole() {
  191. return menuRole;
  192. }
  193. public void setMenuRole(String menuRole) {
  194. this.menuRole = menuRole;
  195. }
  196. public Long getTableId()
  197. {
  198. return tableId;
  199. }
  200. public void setTableId(Long tableId)
  201. {
  202. this.tableId = tableId;
  203. }
  204. public String getTableName()
  205. {
  206. return tableName;
  207. }
  208. public void setTableName(String tableName)
  209. {
  210. this.tableName = tableName;
  211. }
  212. public String getTableComment()
  213. {
  214. return tableComment;
  215. }
  216. public void setTableComment(String tableComment)
  217. {
  218. this.tableComment = tableComment;
  219. }
  220. public String getSubTableName()
  221. {
  222. return subTableName;
  223. }
  224. public void setSubTableName(String subTableName)
  225. {
  226. this.subTableName = subTableName;
  227. }
  228. public String getSubTableFkName()
  229. {
  230. return subTableFkName;
  231. }
  232. public void setSubTableFkName(String subTableFkName)
  233. {
  234. this.subTableFkName = subTableFkName;
  235. }
  236. public String getClassName()
  237. {
  238. return className;
  239. }
  240. public void setClassName(String className)
  241. {
  242. this.className = className;
  243. }
  244. public String getTplCategory()
  245. {
  246. return tplCategory;
  247. }
  248. public void setTplCategory(String tplCategory)
  249. {
  250. this.tplCategory = tplCategory;
  251. }
  252. public String getPackageName()
  253. {
  254. return packageName;
  255. }
  256. public void setPackageName(String packageName)
  257. {
  258. this.packageName = packageName;
  259. }
  260. public String getModuleName()
  261. {
  262. return moduleName;
  263. }
  264. public void setModuleName(String moduleName)
  265. {
  266. this.moduleName = moduleName;
  267. }
  268. public String getBusinessName()
  269. {
  270. return businessName;
  271. }
  272. public void setBusinessName(String businessName)
  273. {
  274. this.businessName = businessName;
  275. }
  276. public String getFunctionName()
  277. {
  278. return functionName;
  279. }
  280. public void setFunctionName(String functionName)
  281. {
  282. this.functionName = functionName;
  283. }
  284. public String getFunctionAuthor()
  285. {
  286. return functionAuthor;
  287. }
  288. public void setFunctionAuthor(String functionAuthor)
  289. {
  290. this.functionAuthor = functionAuthor;
  291. }
  292. public String getGenType()
  293. {
  294. return genType;
  295. }
  296. public void setGenType(String genType)
  297. {
  298. this.genType = genType;
  299. }
  300. public String getGenPath()
  301. {
  302. return genPath;
  303. }
  304. public void setGenPath(String genPath)
  305. {
  306. this.genPath = genPath;
  307. }
  308. public GenTableColumn getPkColumn()
  309. {
  310. return pkColumn;
  311. }
  312. public void setPkColumn(GenTableColumn pkColumn)
  313. {
  314. this.pkColumn = pkColumn;
  315. }
  316. public GenTable getSubTable()
  317. {
  318. return subTable;
  319. }
  320. public void setSubTable(GenTable subTable)
  321. {
  322. this.subTable = subTable;
  323. }
  324. public List<GenTableColumn> getColumns()
  325. {
  326. return columns;
  327. }
  328. public void setColumns(List<GenTableColumn> columns)
  329. {
  330. this.columns = columns;
  331. }
  332. public String getOptions()
  333. {
  334. return options;
  335. }
  336. public void setOptions(String options)
  337. {
  338. this.options = options;
  339. }
  340. public String getTreeCode()
  341. {
  342. return treeCode;
  343. }
  344. public void setTreeCode(String treeCode)
  345. {
  346. this.treeCode = treeCode;
  347. }
  348. public String getTreeParentCode()
  349. {
  350. return treeParentCode;
  351. }
  352. public void setTreeParentCode(String treeParentCode)
  353. {
  354. this.treeParentCode = treeParentCode;
  355. }
  356. public String getTreeName()
  357. {
  358. return treeName;
  359. }
  360. public void setTreeName(String treeName)
  361. {
  362. this.treeName = treeName;
  363. }
  364. public String getParentMenuId()
  365. {
  366. return parentMenuId;
  367. }
  368. public void setParentMenuId(String parentMenuId)
  369. {
  370. this.parentMenuId = parentMenuId;
  371. }
  372. public String getParentMenuName()
  373. {
  374. return parentMenuName;
  375. }
  376. public void setParentMenuName(String parentMenuName)
  377. {
  378. this.parentMenuName = parentMenuName;
  379. }
  380. public boolean isSub()
  381. {
  382. return isSub(this.tplCategory);
  383. }
  384. public static boolean isSub(String tplCategory)
  385. {
  386. return tplCategory != null && StringUtils.equals(GenConstants.TPL_SUB, tplCategory);
  387. }
  388. public boolean isTree()
  389. {
  390. return isTree(this.tplCategory);
  391. }
  392. public static boolean isTree(String tplCategory)
  393. {
  394. return tplCategory != null && StringUtils.equals(GenConstants.TPL_TREE, tplCategory);
  395. }
  396. public boolean isCrud()
  397. {
  398. return isCrud(this.tplCategory);
  399. }
  400. public static boolean isCrud(String tplCategory)
  401. {
  402. return tplCategory != null && StringUtils.equals(GenConstants.TPL_CRUD, tplCategory);
  403. }
  404. public boolean isSuperColumn(String javaField)
  405. {
  406. return isSuperColumn(this.tplCategory, javaField);
  407. }
  408. public static boolean isSuperColumn(String tplCategory, String javaField)
  409. {
  410. if (isTree(tplCategory))
  411. {
  412. return StringUtils.equalsAnyIgnoreCase(javaField,
  413. ArrayUtils.addAll(GenConstants.TREE_ENTITY, GenConstants.BASE_ENTITY));
  414. }
  415. return StringUtils.equalsAnyIgnoreCase(javaField, GenConstants.BASE_ENTITY);
  416. }
  417. public List<GenTable> getRelationList() {
  418. return relationList;
  419. }
  420. public void setRelationList(List<GenTable> relationList) {
  421. this.relationList = relationList;
  422. }
  423. }