EasyUI的功能樹之非同步樹
阿新 • • 發佈:2019-01-04
1 import java.util.HashSet;
2 import java.util.Set;
3 import javax.persistence.CascadeType;
4 import javax.persistence.Column;
5 import javax.persistence.Entity;
6 import javax.persistence.FetchType;
7 import javax.persistence.Id;
8 import javax.persistence.JoinColumn;
9 import javax.persistence.ManyToOne;
10 import javax.persistence.OneToMany;
11 import javax.persistence.Table;
12
13 /**
14 * TMenu entity. @author MyEclipse Persistence Tools
15 */
16 @Entity
17 @Table(name = "t_menu", catalog = "easyui")
18 public class TMenu implements java.io.Serializable {
19
20 // Fields
21
22 private String id;
23 private TMenu TMenu;
24 private String text;
25 private String iconCls;
26 private String url;
27 private Set<TMenu> TMenus = new HashSet<TMenu>(0);
28
29 // Constructors
30
31 /** default constructor */
32 public TMenu() {
33 }
34
35 /** minimal constructor */
36 public TMenu(String id) {
37 this.id = id;
38 }
39
40 /** full constructor */
41 public TMenu(String id, TMenu TMenu, String text, String iconCls, String url, Set<TMenu> TMenus) {
42 this.id = id;
43 this.TMenu = TMenu;
44 this.text = text;
45 this.iconCls = iconCls;
46 this.url = url;
47 this.TMenus = TMenus;
48 }
49
50 // Property accessors
51 @Id
52 @Column(name = "id", unique = true, nullable = false, length = 36)
53 public String getId() {
54 return this.id;
55 }
56
57 public void setId(String id) {
58 this.id = id;
59 }
60
61 @ManyToOne(fetch = FetchType.LAZY)
62 @JoinColumn(name = "pid")
63 public TMenu getTMenu() {
64 return this.TMenu;
65 }
66
67 public void setTMenu(TMenu TMenu) {
68 this.TMenu = TMenu;
69 }
70
71 @Column(name = "text", length = 100)
72 public String getText() {
73 return this.text;
74 }
75
76 public void setText(String text) {
77 this.text = text;
78 }
79
80 @Column(name = "iconCls", length = 50)
81 public String getIconCls() {
82 return this.iconCls;
83 }
84
85 public void setIconCls(String iconCls) {
86 this.iconCls = iconCls;
87 }
88
89 @Column(name = "url", length = 200)
90 public String getUrl() {
91 return this.url;
92 }
93
94 public void setUrl(String url) {
95 this.url = url;
96 }
97
98 @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "TMenu")
99 public Set<TMenu> getTMenus() {
100 return this.TMenus;
101 }
102
103 public void setTMenus(Set<TMenu> TMenus) {
104 this.TMenus = TMenus;
105 }
106
107 }
2 import java.util.Set;
3 import javax.persistence.CascadeType;
4 import javax.persistence.Column;
5 import javax.persistence.Entity;
6 import javax.persistence.FetchType;
7 import javax.persistence.Id;
8 import javax.persistence.JoinColumn;
9 import javax.persistence.ManyToOne;
11 import javax.persistence.Table;
12
13 /**
14 * TMenu entity. @author MyEclipse Persistence Tools
15 */
16 @Entity
17 @Table(name = "t_menu", catalog = "easyui")
18 public class TMenu implements java.io.Serializable {
19
20 // Fields
21
22 private String id;
24 private String text;
25 private String iconCls;
26 private String url;
27 private Set<TMenu> TMenus = new HashSet<TMenu>(0);
28
29 // Constructors
30
31 /** default constructor */
32 public TMenu() {
33 }
34
35 /** minimal constructor
36 public TMenu(String id) {
37 this.id = id;
38 }
39
40 /** full constructor */
41 public TMenu(String id, TMenu TMenu, String text, String iconCls, String url, Set<TMenu> TMenus) {
42 this.id = id;
43 this.TMenu = TMenu;
44 this.text = text;
45 this.iconCls = iconCls;
46 this.url = url;
47 this.TMenus = TMenus;
48 }
49
50 // Property accessors
51 @Id
52 @Column(name = "id", unique = true, nullable = false, length = 36)
53 public String getId() {
54 return this.id;
55 }
56
57 public void setId(String id) {
58 this.id = id;
59 }
60
61 @ManyToOne(fetch = FetchType.LAZY)
62 @JoinColumn(name = "pid")
63 public TMenu getTMenu() {
64 return this.TMenu;
65 }
66
67 public void setTMenu(TMenu TMenu) {
68 this.TMenu = TMenu;
69 }
70
71 @Column(name = "text", length = 100)
72 public String getText() {
73 return this.text;
74 }
75
76 public void setText(String text) {
77 this.text = text;
78 }
79
80 @Column(name = "iconCls", length = 50)
81 public String getIconCls() {
82 return this.iconCls;
83 }
84
85 public void setIconCls(String iconCls) {
86 this.iconCls = iconCls;
87 }
88
89 @Column(name = "url", length = 200)
90 public String getUrl() {
91 return this.url;
92 }
93
94 public void setUrl(String url) {
95 this.url = url;
96 }
97
98 @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "TMenu")
99 public Set<TMenu> getTMenus() {
100 return this.TMenus;
101 }
102
103 public void setTMenus(Set<TMenu> TMenus) {
104 this.TMenus = TMenus;
105 }
106
107 }