Subversion Repositories WebE

Rev

Rev 34 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

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