BaseCheckDemo.java

  1. package com.example.entity.demo_4.base_1;
  2. @Entity
  3. @DynamicInsert
  4. @DodoEntity(name = "字段校验", actions = { DodoAction.ALL })
  5. @DodoMenus(
  6. levelOne = @DodoMenu(name = "Demo系统", sortSeq = 7),
  7. levelTwo = @DodoMenu(name = "基础演示", sortSeq = 1),
  8. levelThree = @DodoMenu(name = "字段校验演示", sortSeq = 5)
  9. )
  10. @DodoUniqueGroup(fieldNames = { "clazz", "name" })
  11. public class BaseCheckDemo extends BaseEntity {
  12. private static final long serialVersionUID = -5083977727340920244L;
  13. @DodoField(sortSeq = 1, name = "IP地址", isIp = true, queryOnList = true)
  14. private String ipAddr;
  15. @DodoField(sortSeq = 2, name = "邮箱", isEmail = true)
  16. private String emailAddr;
  17. @DodoField(sortSeq = 3, name = "URL", isUrl = true)
  18. private String urlStr;
  19. @DodoField(sortSeq = 4, name = "数据库唯一", isRemoteCheck = true)
  20. private String remoteStr;
  21. @DodoField(sortSeq = 5, name = "限制长度", minLength = 3, maxLength = 10)
  22. private String lengthStr;
  23. @DodoField(sortSeq = 6, name = "非空", isnullable = false)
  24. private String notnullStr;
  25. @DodoField(sortSeq = 7, name = "限制大小", min = "666", max = "888")
  26. private Integer maxminNumber;
  27. @DodoField(sortSeq = 8, name = "城市1", infoTip = "弹出选择,所有名字包含'张'的城市", queryParams = "like(\"name\",\"张\")", isPopup = true, queryOnList = true)
  28. private City city1;
  29. @DodoField(sortSeq = 9, name = "城市2", infoTip = "所有名字包含'门'的城市", queryParams = "like(\"name\",\"门\")")
  30. private City city2;
  31. @DodoField(sortSeq = 11, name = "自动取值:数据库")
  32. @DodoValueGenerator
  33. private String autoValue1;
  34. @DodoField(sortSeq = 12, name = "自动取值:自定义方法")
  35. @DodoValueGenerator(generateClass = com.example.utils.AutoValue.class, generateMethodName = "getAutoValue")
  36. private String autoValue2;
  37. @DodoField(sortSeq = 13, name = "正则校验", regExp = "\\d{3,8}", regExpTip = "请输入我设定的规则~~哈", infoTip = "正则:3-8位数字")
  38. private String regStr;
  39. @DodoField(sortSeq = 20, name = "1M以内图片", isFile = true, fileStyle = FileStyle.OnlyPath, fileType = { @DodoFileType(title = "图片文件", extensions = "jpg,jpeg,gif,png,bmp") }, maxFileSize = 1)
  40. private String imageField;
  41. @DodoField(sortSeq = 21, name = "班级", isSetDefault = false, infoTip = "与'姓名'联合唯一")
  42. private String clazz;
  43. @DodoField(sortSeq = 22, name = "姓名", isSetDefault = false, infoTip = "与'班级'联合唯一")
  44. private String name;
  45. @Column(length = 32)
  46. public String getIpAddr() {
  47. return ipAddr;
  48. }
  49. public void setIpAddr(String ipAddr) {
  50. this.ipAddr = ipAddr;
  51. }
  52. @Column(length = 32)
  53. public String getEmailAddr() {
  54. return emailAddr;
  55. }
  56. public void setEmailAddr(String emailAddr) {
  57. this.emailAddr = emailAddr;
  58. }
  59. @Column(length = 64)
  60. public String getUrlStr() {
  61. return urlStr;
  62. }
  63. public void setUrlStr(String urlStr) {
  64. this.urlStr = urlStr;
  65. }
  66. @Column(length = 16)
  67. public String getRemoteStr() {
  68. return remoteStr;
  69. }
  70. public void setRemoteStr(String remoteStr) {
  71. this.remoteStr = remoteStr;
  72. }
  73. @Column(length = 16)
  74. public String getLengthStr() {
  75. return lengthStr;
  76. }
  77. public void setLengthStr(String lengthStr) {
  78. this.lengthStr = lengthStr;
  79. }
  80. @Column(length = 8)
  81. public String getNotnullStr() {
  82. return notnullStr;
  83. }
  84. public void setNotnullStr(String notnullStr) {
  85. this.notnullStr = notnullStr;
  86. }
  87. public Integer getMaxminNumber() {
  88. return maxminNumber;
  89. }
  90. public void setMaxminNumber(Integer maxminNumber) {
  91. this.maxminNumber = maxminNumber;
  92. }
  93. @OneToOne
  94. public City getCity1() {
  95. return city1;
  96. }
  97. public void setCity1(City city1) {
  98. this.city1 = city1;
  99. }
  100. @OneToOne
  101. public City getCity2() {
  102. return city2;
  103. }
  104. public void setCity2(City city2) {
  105. this.city2 = city2;
  106. }
  107. @Column(length = 16)
  108. public String getAutoValue1() {
  109. return autoValue1;
  110. }
  111. public void setAutoValue1(String autoValue1) {
  112. this.autoValue1 = autoValue1;
  113. }
  114. @Column(length = 32)
  115. public String getAutoValue2() {
  116. return autoValue2;
  117. }
  118. public void setAutoValue2(String autoValue2) {
  119. this.autoValue2 = autoValue2;
  120. }
  121. @Column(length = 16)
  122. public String getRegStr() {
  123. return regStr;
  124. }
  125. public void setRegStr(String regStr) {
  126. this.regStr = regStr;
  127. }
  128. @Column(length = 128)
  129. public String getImageField() {
  130. return imageField;
  131. }
  132. public void setImageField(String imageField) {
  133. this.imageField = imageField;
  134. }
  135. @Column(length = 8)
  136. public String getClazz() {
  137. return clazz;
  138. }
  139. public void setClazz(String clazz) {
  140. this.clazz = clazz;
  141. }
  142. @Column(length = 8)
  143. public String getName() {
  144. return name;
  145. }
  146. public void setName(String name) {
  147. this.name = name;
  148. }
  149. }