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