CascadeDemo.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 = 8)
  9. )
  10. public class CascadeDemo extends BaseEntity {
  11. private static final long serialVersionUID = 2236186294198415373L;
  12. @DodoViewGroup(groupSeq = 1, groupName = "第一组级联")
  13. @DodoField(name = "国家", sortSeq = 2, infoTip = "切换时,省份级联")
  14. @DodoCascade(group = 0)
  15. private Country country;
  16. @DodoViewGroup(groupSeq = 1, groupName = "第一组级联")
  17. @DodoField(name = "省份", sortSeq = 3, infoTip = "切换时,城市级联")
  18. @DodoCascade(group = 0, parentField = "country")
  19. private Province province;
  20. @DodoViewGroup(groupSeq = 1, groupName = "第一组级联")
  21. @DodoField(name = "城市", sortSeq = 4, infoTip = "切换时,区域级联")
  22. @DodoCascade(group = 0, parentField = "province")
  23. private City city;
  24. @DodoViewGroup(groupSeq = 1, groupName = "第一组级联")
  25. @DodoField(name = "区域", sortSeq = 5)
  26. @DodoCascade(group = 0, parentField = "city")
  27. private District area;
  28. @DodoViewGroup(groupSeq = 2, groupName = "第二组级联")
  29. @DodoField(name = "国家2", sortSeq = 2, infoTip = "切换时,省份(2)省份(3) 都级联", isPopup = true)
  30. @DodoCascade(group = 1)
  31. private Country country2;
  32. @DodoViewGroup(groupSeq = 2, groupName = "第二组级联")
  33. @DodoField(name = "省份(2)", sortSeq = 3, infoTip = "切换时,城市(2)级联")
  34. @DodoCascade(group = 1, parentField = "country2")
  35. private Province province2;
  36. @DodoViewGroup(groupSeq = 2, groupName = "第二组级联")
  37. @DodoField(name = "省份(3)", sortSeq = 3, infoTip = "切换时,城市(3)级联")
  38. @DodoCascade(group = 1, parentField = "country2")
  39. private Province province3;
  40. @DodoViewGroup(groupSeq = 2, groupName = "第二组级联")
  41. @DodoField(name = "城市(2)", sortSeq = 4, infoTip = "切换时,区域(2)级联")
  42. @DodoCascade(group = 1, parentField = "province2")
  43. private City city2;
  44. @DodoViewGroup(groupSeq = 2, groupName = "第二组级联")
  45. @DodoField(name = "城市(3)", sortSeq = 4, infoTip = "切换时,无级联")
  46. @DodoCascade(group = 1, parentField = "province3")
  47. private City city3;
  48. @DodoViewGroup(groupSeq = 2, groupName = "第二组级联")
  49. @DodoField(name = "区域(2)", sortSeq = 5)
  50. @DodoCascade(group = 1, parentField = "city2")
  51. private District area2;
  52. @OneToOne
  53. public Country getCountry() {
  54. return country;
  55. }
  56. public void setCountry(Country country) {
  57. this.country = country;
  58. }
  59. @OneToOne
  60. public Province getProvince() {
  61. return province;
  62. }
  63. public void setProvince(Province province) {
  64. this.province = province;
  65. }
  66. @OneToOne
  67. public City getCity() {
  68. return city;
  69. }
  70. public void setCity(City city) {
  71. this.city = city;
  72. }
  73. @OneToOne
  74. public District getArea() {
  75. return area;
  76. }
  77. public void setArea(District area) {
  78. this.area = area;
  79. }
  80. @OneToOne
  81. public Country getCountry2() {
  82. return country2;
  83. }
  84. public void setCountry2(Country country2) {
  85. this.country2 = country2;
  86. }
  87. @OneToOne
  88. public Province getProvince2() {
  89. return province2;
  90. }
  91. public void setProvince2(Province province2) {
  92. this.province2 = province2;
  93. }
  94. @OneToOne
  95. public Province getProvince3() {
  96. return province3;
  97. }
  98. public void setProvince3(Province province3) {
  99. this.province3 = province3;
  100. }
  101. @OneToOne
  102. public City getCity2() {
  103. return city2;
  104. }
  105. public void setCity2(City city2) {
  106. this.city2 = city2;
  107. }
  108. @OneToOne
  109. public City getCity3() {
  110. return city3;
  111. }
  112. public void setCity3(City city3) {
  113. this.city3 = city3;
  114. }
  115. @OneToOne
  116. public District getArea2() {
  117. return area2;
  118. }
  119. public void setArea2(District area2) {
  120. this.area2 = area2;
  121. }
  122. }