Rev 33 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 33 | Rev 34 | ||
---|---|---|---|
1 | package ch.ffhs.webE.domain; |
1 | package ch.ffhs.webE.domain; |
2 | 2 | ||
3 | // Generated 19.12.2010 14:46:08 by Hibernate Tools 3.4.0.Beta1
|
3 | // Generated 19.12.2010 14:46:08 by Hibernate Tools 3.4.0.Beta1
|
4 | 4 | ||
5 | import java.io.Serializable; |
5 | import java.io.Serializable; |
6 | import java.util.HashSet; |
6 | import java.util.HashSet; |
7 | import java.util.Set; |
7 | import java.util.Set; |
8 | 8 | ||
9 | import javax.persistence.CascadeType; |
9 | import javax.persistence.CascadeType; |
10 | import javax.persistence.Column; |
10 | import javax.persistence.Column; |
11 | import javax.persistence.Entity; |
11 | import javax.persistence.Entity; |
12 | import javax.persistence.FetchType; |
12 | import javax.persistence.FetchType; |
13 | import javax.persistence.GeneratedValue; |
13 | import javax.persistence.GeneratedValue; |
14 | import javax.persistence.Id; |
14 | import javax.persistence.Id; |
15 | import javax.persistence.OneToMany; |
15 | import javax.persistence.OneToMany; |
16 | import javax.persistence.OneToOne; |
16 | import javax.persistence.OneToOne; |
17 | import javax.persistence.PrimaryKeyJoinColumn; |
17 | import javax.persistence.PrimaryKeyJoinColumn; |
18 | import javax.persistence.Table; |
18 | import javax.persistence.Table; |
19 | import javax.persistence.Transient; |
19 | import javax.persistence.Transient; |
20 | import javax.persistence.UniqueConstraint; |
20 | import javax.persistence.UniqueConstraint; |
21 | 21 | ||
22 | import org.hibernate.annotations.GenericGenerator; |
22 | import org.hibernate.annotations.GenericGenerator; |
23 | import org.hibernate.annotations.Parameter; |
23 | import org.hibernate.annotations.Parameter; |
24 | 24 | ||
25 | /**
|
25 | /**
|
26 | * Term generated by hbm2java
|
26 | * Term generated by hbm2java
|
27 | */
|
27 | */
|
28 | @Entity |
28 | @Entity |
29 | @Table(name = "term", catalog = "webengineering", uniqueConstraints = @UniqueConstraint(columnNames = "name")) |
29 | @Table(name = "term", catalog = "webengineering", uniqueConstraints = @UniqueConstraint(columnNames = "name")) |
30 | public class Term implements Serializable |
30 | public class Term implements Serializable |
31 | {
|
31 | {
|
32 | /**
|
32 | /**
|
33 | * Version ID for serialization
|
33 | * Version ID for serialization
|
34 | */
|
34 | */
|
35 | private static final long serialVersionUID = 1L; |
35 | private static final long serialVersionUID = 1L; |
36 | 36 | ||
37 | @Transient |
37 | @Transient |
38 | private int objectId; |
38 | private int objectId; |
39 | 39 | ||
40 | private ObjectEntity object; |
40 | private ObjectEntity object; |
41 | private String name; |
41 | private String name; |
42 | private Set<Relationship> relationshipsForTermTo = new HashSet<Relationship>( |
42 | private Set<Relationship> relationshipsForTermTo = new HashSet<Relationship>( |
43 | 0); |
43 | 0); |
44 | private Set<Relationship> relationshipsForTermFrom = new HashSet<Relationship>( |
44 | private Set<Relationship> relationshipsForTermFrom = new HashSet<Relationship>( |
45 | 0); |
45 | 0); |
46 | 46 | ||
47 | /**
|
47 | /**
|
- | 48 | * @var <code>true</code> if the term is edited/renamed, <code>false</code>
|
|
- | 49 | * otherwise
|
|
- | 50 | */
|
|
- | 51 | public boolean edit = false; |
|
- | 52 | ||
- | 53 | /**
|
|
48 | * No-op constructor
|
54 | * No-op constructor
|
49 | */
|
55 | */
|
50 | public Term() |
56 | public Term() |
51 | {
|
57 | {
|
52 | }
|
58 | }
|
53 | 59 | ||
54 | /**
|
60 | /**
|
55 | * @param object
|
61 | * @param object
|
56 | */
|
62 | */
|
57 | public Term(ObjectEntity object) |
63 | public Term(ObjectEntity object) |
58 | {
|
64 | {
|
59 | this.object = object; |
65 | this.object = object; |
60 | }
|
66 | }
|
61 | 67 | ||
62 | /**
|
68 | /**
|
63 | * @param object
|
69 | * @param object
|
64 | * @param name
|
70 | * @param name
|
65 | * @param relationshipsForTermTo
|
71 | * @param relationshipsForTermTo
|
66 | * @param relationshipsForTermFrom
|
72 | * @param relationshipsForTermFrom
|
67 | */
|
73 | */
|
68 | public Term(ObjectEntity object, String name, |
74 | public Term(ObjectEntity object, String name, |
69 | Set<Relationship> relationshipsForTermTo, |
75 | Set<Relationship> relationshipsForTermTo, |
70 | Set<Relationship> relationshipsForTermFrom) |
76 | Set<Relationship> relationshipsForTermFrom) |
71 | {
|
77 | {
|
72 | this.object = object; |
78 | this.object = object; |
73 | this.name = name; |
79 | this.name = name; |
74 | this.relationshipsForTermTo = relationshipsForTermTo; |
80 | this.relationshipsForTermTo = relationshipsForTermTo; |
75 | this.relationshipsForTermFrom = relationshipsForTermFrom; |
81 | this.relationshipsForTermFrom = relationshipsForTermFrom; |
76 | }
|
82 | }
|
77 | 83 | ||
78 | /**
|
84 | /**
|
79 | * @return
|
85 | * @return
|
80 | */
|
86 | */
|
81 | @GenericGenerator(name = "generator", strategy = "foreign", parameters = @Parameter(name = "property", value = "object")) |
87 | @GenericGenerator(name = "generator", strategy = "foreign", parameters = @Parameter(name = "property", value = "object")) |
82 | @Id |
88 | @Id |
83 | @GeneratedValue(generator = "generator") |
89 | @GeneratedValue(generator = "generator") |
84 | @Column(name = "object_id", unique = true, nullable = false) |
90 | @Column(name = "object_id", unique = true, nullable = false) |
85 | public int getObjectId() |
91 | public int getObjectId() |
86 | {
|
92 | {
|
87 | return this.objectId; |
93 | return this.objectId; |
88 | }
|
94 | }
|
89 | 95 | ||
90 | /**
|
96 | /**
|
91 | * @param objectId
|
97 | * @param objectId
|
92 | */
|
98 | */
|
93 | public void setObjectId(int objectId) |
99 | public void setObjectId(int objectId) |
94 | {
|
100 | {
|
95 | this.objectId = objectId; |
101 | this.objectId = objectId; |
96 | }
|
102 | }
|
97 | 103 | ||
98 | /**
|
104 | /**
|
99 | * @return ObjectEntity domain object
|
105 | * @return ObjectEntity domain object
|
100 | */
|
106 | */
|
101 | @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) |
107 | @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) |
102 | @PrimaryKeyJoinColumn |
108 | @PrimaryKeyJoinColumn |
103 | public ObjectEntity getObject() |
109 | public ObjectEntity getObject() |
104 | {
|
110 | {
|
105 | return this.object; |
111 | return this.object; |
106 | }
|
112 | }
|
107 | 113 | ||
108 | /**
|
114 | /**
|
109 | * @param object
|
115 | * @param object
|
110 | */
|
116 | */
|
111 | public void setObject(ObjectEntity object) |
117 | public void setObject(ObjectEntity object) |
112 | {
|
118 | {
|
113 | this.object = object; |
119 | this.object = object; |
114 | }
|
120 | }
|
115 | 121 | ||
116 | /**
|
122 | /**
|
117 | * @return
|
123 | * @return
|
118 | */
|
124 | */
|
119 | @Column(name = "name", unique = true) |
125 | @Column(name = "name", unique = true) |
120 | public String getName() |
126 | public String getName() |
121 | {
|
127 | {
|
122 | return this.name; |
128 | return this.name; |
123 | }
|
129 | }
|
124 | 130 | ||
125 | /**
|
131 | /**
|
126 | * @param name
|
132 | * @param name
|
127 | */
|
133 | */
|
128 | public void setName(String name) |
134 | public void setName(String name) |
129 | {
|
135 | {
|
130 | this.name = name; |
136 | this.name = name; |
131 | }
|
137 | }
|
132 | 138 | ||
133 | @OneToMany(fetch = FetchType.LAZY, mappedBy = "termByTermTo") |
139 | @OneToMany(fetch = FetchType.LAZY, mappedBy = "termTo") |
134 | public Set<Relationship> getRelationshipsForTermTo() |
140 | public Set<Relationship> getRelationshipsForTermTo() |
135 | {
|
141 | {
|
136 | return this.relationshipsForTermTo; |
142 | return this.relationshipsForTermTo; |
137 | }
|
143 | }
|
138 | 144 | ||
139 | /**
|
145 | /**
|
140 | * @param relationshipsForTermTo
|
146 | * @param relationshipsForTermTo
|
141 | */
|
147 | */
|
142 | public void setRelationshipsForTermTo(Set<Relationship> relationshipsForTermTo) |
148 | public void setRelationshipsForTermTo(Set<Relationship> relationshipsForTermTo) |
143 | {
|
149 | {
|
144 | this.relationshipsForTermTo = relationshipsForTermTo; |
150 | this.relationshipsForTermTo = relationshipsForTermTo; |
145 | }
|
151 | }
|
146 | 152 | ||
147 | /**
|
153 | /**
|
148 | * @return
|
154 | * @return
|
149 | */
|
155 | */
|
150 | @OneToMany(fetch = FetchType.LAZY, mappedBy = "termByTermFrom") |
156 | @OneToMany(fetch = FetchType.LAZY, mappedBy = "termFrom") |
151 | public Set<Relationship> getRelationshipsForTermFrom() |
157 | public Set<Relationship> getRelationshipsForTermFrom() |
152 | {
|
158 | {
|
153 | return this.relationshipsForTermFrom; |
159 | return this.relationshipsForTermFrom; |
154 | }
|
160 | }
|
155 | 161 | ||
156 | /**
|
162 | /**
|
157 | * @param relationshipsForTermFrom
|
163 | * @param relationshipsForTermFrom
|
158 | */
|
164 | */
|
159 | public void setRelationshipsForTermFrom( |
165 | public void setRelationshipsForTermFrom( |
160 | Set<Relationship> relationshipsForTermFrom) |
166 | Set<Relationship> relationshipsForTermFrom) |
161 | {
|
167 | {
|
162 | this.relationshipsForTermFrom = relationshipsForTermFrom; |
168 | this.relationshipsForTermFrom = relationshipsForTermFrom; |
163 | }
|
169 | }
|
164 | 170 | ||
165 | }
|
171 | }
|
166 | 172 |