tbl.ftl 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <#include "../function.ftl">
  2. <#include "../variable.ftl">
  3. <#assign pkVar=convertUnderLine(pk) >
  4. <#if isBaseModule = 'true'>
  5. package com.${cAlias}.${cPlatform}.${sys}.persistence.entity;
  6. <#else>
  7. package com.${cAlias}.${cPlatform}.${sys}.${module}.persistence.entity;
  8. </#if>
  9. <#if subtables?exists && subtables?size!=0>
  10. import java.util.ArrayList;
  11. import java.util.List;
  12. </#if>
  13. import org.apache.commons.lang.builder.ToStringBuilder;
  14. import com.${scAlias}.${scPlatform}.base.framework.persistence.entity.AbstractPo;
  15. /**
  16. * ${model.tabComment} 表对象
  17. *
  18. *<pre>
  19. <#if vars.company?exists>
  20. * 开发公司:${vars.company}
  21. </#if>
  22. <#if vars.developer?exists>
  23. * 开发人员:${vars.developer}
  24. </#if>
  25. <#if vars.email?exists>
  26. * 邮箱地址:${vars.email}
  27. </#if>
  28. * 创建时间:${date?string("yyyy-MM-dd HH:mm:ss")}
  29. *</pre>
  30. */
  31. @SuppressWarnings("serial")
  32. public class ${class}Tbl extends AbstractPo<String>{
  33. <#list model.columnList as col>
  34. protected ${col.colType} ${convertUnderLine(col.columnName)}; /*${col.comment}*/
  35. </#list>
  36. <#if (pkVar!="id")>
  37. @Override
  38. public void setId(String ${pkVar}) {
  39. this.${pkVar} = ${pkVar};
  40. }
  41. @Override
  42. public String getId() {
  43. return ${pkVar};
  44. }
  45. </#if>
  46. <#list model.columnList as col>
  47. <#assign colName=convertUnderLine(col.columnName)>
  48. public void set${colName?cap_first}(${col.colType} ${colName})
  49. {
  50. this.${colName} = ${colName};
  51. }
  52. /**
  53. * 返回 ${col.comment}
  54. * @return
  55. */
  56. public ${col.colType} get${colName?cap_first}()
  57. {
  58. return this.${colName};
  59. }
  60. </#list>
  61. /**
  62. * @see java.lang.Object#toString()
  63. */
  64. public String toString()
  65. {
  66. return new ToStringBuilder(this)
  67. <#list model.columnList as col>
  68. <#assign colName=convertUnderLine(col.columnName)>
  69. .append("${colName}", this.${colName})
  70. </#list>
  71. .toString();
  72. }
  73. }