Go to most recent revision | Details | 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 | |||
5 | import java.util.HashSet; |
||
6 | import java.util.Set; |
||
7 | import javax.persistence.Column; |
||
8 | import javax.persistence.Entity; |
||
9 | import javax.persistence.FetchType; |
||
10 | import javax.persistence.GeneratedValue; |
||
11 | import static javax.persistence.GenerationType.IDENTITY; |
||
12 | import javax.persistence.Id; |
||
13 | import javax.persistence.OneToMany; |
||
14 | import javax.persistence.Table; |
||
15 | import javax.persistence.UniqueConstraint; |
||
16 | |||
17 | /** |
||
18 | * RelationshipType generated by hbm2java |
||
19 | */ |
||
20 | @Entity |
||
21 | @Table(name = "relationship_type", catalog = "webengineering", uniqueConstraints = @UniqueConstraint(columnNames = "name_from")) |
||
22 | public class RelationshipType implements java.io.Serializable { |
||
23 | |||
24 | private Integer relationshipId; |
||
25 | private String nameFrom; |
||
26 | private String nameTo; |
||
27 | private Set<Relationship> relationships = new HashSet<Relationship>(0); |
||
28 | |||
29 | public RelationshipType() { |
||
30 | } |
||
31 | |||
32 | public RelationshipType(String nameFrom, String nameTo) { |
||
33 | this.nameFrom = nameFrom; |
||
34 | this.nameTo = nameTo; |
||
35 | } |
||
36 | |||
37 | public RelationshipType(String nameFrom, String nameTo, |
||
38 | Set<Relationship> relationships) { |
||
39 | this.nameFrom = nameFrom; |
||
40 | this.nameTo = nameTo; |
||
41 | this.relationships = relationships; |
||
42 | } |
||
43 | |||
44 | @Id |
||
45 | @GeneratedValue(strategy = IDENTITY) |
||
46 | @Column(name = "relationship_id", unique = true, nullable = false) |
||
47 | public Integer getRelationshipId() { |
||
48 | return this.relationshipId; |
||
49 | } |
||
50 | |||
51 | public void setRelationshipId(Integer relationshipId) { |
||
52 | this.relationshipId = relationshipId; |
||
53 | } |
||
54 | |||
55 | @Column(name = "name_from", unique = true, nullable = false) |
||
56 | public String getNameFrom() { |
||
57 | return this.nameFrom; |
||
58 | } |
||
59 | |||
60 | public void setNameFrom(String nameFrom) { |
||
61 | this.nameFrom = nameFrom; |
||
62 | } |
||
63 | |||
64 | @Column(name = "name_to", nullable = false) |
||
65 | public String getNameTo() { |
||
66 | return this.nameTo; |
||
67 | } |
||
68 | |||
69 | public void setNameTo(String nameTo) { |
||
70 | this.nameTo = nameTo; |
||
71 | } |
||
72 | |||
73 | @OneToMany(fetch = FetchType.LAZY, mappedBy = "relationshipType") |
||
74 | public Set<Relationship> getRelationships() { |
||
75 | return this.relationships; |
||
76 | } |
||
77 | |||
78 | public void setRelationships(Set<Relationship> relationships) { |
||
79 | this.relationships = relationships; |
||
80 | } |
||
81 | |||
82 | } |