Subversion Repositories WebE

Rev

Rev 34 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 34 Rev 35
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
  /**
-
 
54
   * No-op constructor
48
   * No-op constructor
55
   */
49
   */
56
  public Term()
50
  public Term()
57
  {
51
  {
58
  }
52
  }
59
53
60
  /**
54
  /**
61
   * @param object
55
   * @param object
62
   */
56
   */
63
  public Term(ObjectEntity object)
57
  public Term(ObjectEntity object)
64
  {
58
  {
65
    this.object = object;
59
    this.object = object;
66
  }
60
  }
67
61
68
  /**
62
  /**
69
   * @param object
63
   * @param object
70
   * @param name
64
   * @param name
71
   * @param relationshipsForTermTo
65
   * @param relationshipsForTermTo
72
   * @param relationshipsForTermFrom
66
   * @param relationshipsForTermFrom
73
   */
67
   */
74
  public Term(ObjectEntity object, String name,
68
  public Term(ObjectEntity object, String name,
75
      Set<Relationship> relationshipsForTermTo,
69
      Set<Relationship> relationshipsForTermTo,
76
      Set<Relationship> relationshipsForTermFrom)
70
      Set<Relationship> relationshipsForTermFrom)
77
  {
71
  {
78
    this.object = object;
72
    this.object = object;
79
    this.name = name;
73
    this.name = name;
80
    this.relationshipsForTermTo = relationshipsForTermTo;
74
    this.relationshipsForTermTo = relationshipsForTermTo;
81
    this.relationshipsForTermFrom = relationshipsForTermFrom;
75
    this.relationshipsForTermFrom = relationshipsForTermFrom;
82
  }
76
  }
83
77
84
  /**
78
  /**
85
   * @return
79
   * @return
86
   */
80
   */
87
  @GenericGenerator(name = "generator", strategy = "foreign", parameters = @Parameter(name = "property", value = "object"))
81
  @GenericGenerator(name = "generator", strategy = "foreign", parameters = @Parameter(name = "property", value = "object"))
88
  @Id
82
  @Id
89
  @GeneratedValue(generator = "generator")
83
  @GeneratedValue(generator = "generator")
90
  @Column(name = "object_id", unique = true, nullable = false)
84
  @Column(name = "object_id", unique = true, nullable = false)
91
  public int getObjectId()
85
  public int getObjectId()
92
  {
86
  {
93
    return this.objectId;
87
    return this.objectId;
94
  }
88
  }
95
89
96
  /**
90
  /**
97
   * @param objectId
91
   * @param objectId
98
   */
92
   */
99
  public void setObjectId(int objectId)
93
  public void setObjectId(int objectId)
100
  {
94
  {
101
    this.objectId = objectId;
95
    this.objectId = objectId;
102
  }
96
  }
103
97
104
  /**
98
  /**
105
   * @return ObjectEntity domain object
99
   * @return ObjectEntity domain object
106
   */
100
   */
107
  @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
101
  @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
108
  @PrimaryKeyJoinColumn
102
  @PrimaryKeyJoinColumn
109
  public ObjectEntity getObject()
103
  public ObjectEntity getObject()
110
  {
104
  {
111
    return this.object;
105
    return this.object;
112
  }
106
  }
113
107
114
  /**
108
  /**
115
   * @param object
109
   * @param object
116
   */
110
   */
117
  public void setObject(ObjectEntity object)
111
  public void setObject(ObjectEntity object)
118
  {
112
  {
119
    this.object = object;
113
    this.object = object;
120
  }
114
  }
121
115
122
  /**
116
  /**
123
   * @return
117
   * @return
124
   */
118
   */
125
  @Column(name = "name", unique = true)
119
  @Column(name = "name", unique = true)
126
  public String getName()
120
  public String getName()
127
  {
121
  {
128
    return this.name;
122
    return this.name;
129
  }
123
  }
130
124
131
  /**
125
  /**
132
   * @param name
126
   * @param name
133
   */
127
   */
134
  public void setName(String name)
128
  public void setName(String name)
135
  {
129
  {
136
    this.name = name;
130
    this.name = name;
137
  }
131
  }
138
132
139
  @OneToMany(fetch = FetchType.LAZY, mappedBy = "termTo")
133
  @OneToMany(fetch = FetchType.LAZY, mappedBy = "termTo")
140
  public Set<Relationship> getRelationshipsForTermTo()
134
  public Set<Relationship> getRelationshipsForTermTo()
141
  {
135
  {
142
    return this.relationshipsForTermTo;
136
    return this.relationshipsForTermTo;
143
  }
137
  }
144
138
145
  /**
139
  /**
146
   * @param relationshipsForTermTo
140
   * @param relationshipsForTermTo
147
   */
141
   */
148
  public void setRelationshipsForTermTo(Set<Relationship> relationshipsForTermTo)
142
  public void setRelationshipsForTermTo(Set<Relationship> relationshipsForTermTo)
149
  {
143
  {
150
    this.relationshipsForTermTo = relationshipsForTermTo;
144
    this.relationshipsForTermTo = relationshipsForTermTo;
151
  }
145
  }
152
146
153
  /**
147
  /**
154
   * @return
148
   * @return
155
   */
149
   */
156
  @OneToMany(fetch = FetchType.LAZY, mappedBy = "termFrom")
150
  @OneToMany(fetch = FetchType.LAZY, mappedBy = "termFrom")
157
  public Set<Relationship> getRelationshipsForTermFrom()
151
  public Set<Relationship> getRelationshipsForTermFrom()
158
  {
152
  {
159
    return this.relationshipsForTermFrom;
153
    return this.relationshipsForTermFrom;
160
  }
154
  }
161
155
162
  /**
156
  /**
163
   * @param relationshipsForTermFrom
157
   * @param relationshipsForTermFrom
164
   */
158
   */
165
  public void setRelationshipsForTermFrom(
159
  public void setRelationshipsForTermFrom(
166
      Set<Relationship> relationshipsForTermFrom)
160
      Set<Relationship> relationshipsForTermFrom)
167
  {
161
  {
168
    this.relationshipsForTermFrom = relationshipsForTermFrom;
162
    this.relationshipsForTermFrom = relationshipsForTermFrom;
169
  }
163
  }
170
164
171
}
165
}
172
 
166