Mercurial > lada > lada-server
annotate src/main/java/de/intevation/lada/model/land/Ortszuordnung.java @ 1302:1bf808b67403
Set 'letzte_aenderung' to be no insertable. Use database default now() as initial value.
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Tue, 28 Feb 2017 09:47:54 +0100 |
parents | 6e393b614edf |
children |
rev | line source |
---|---|
1097
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.lada.model.land; |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
2 |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
3 import java.io.Serializable; |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
4 import java.sql.Timestamp; |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
5 |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
6 import javax.persistence.Column; |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
7 import javax.persistence.Entity; |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
8 import javax.persistence.GeneratedValue; |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
9 import javax.persistence.GenerationType; |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
10 import javax.persistence.Id; |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
11 import javax.persistence.JoinColumn; |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
12 import javax.persistence.OneToOne; |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
13 import javax.persistence.Transient; |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
14 |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
15 |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
16 /** |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
17 * The persistent class for the ortszuordnung database table. |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
18 * |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
19 */ |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
20 @Entity |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
21 public class Ortszuordnung implements Serializable { |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
22 private static final long serialVersionUID = 1L; |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
23 |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
24 @Id |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
25 @GeneratedValue(strategy=GenerationType.IDENTITY) |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
26 private Integer id; |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
27 |
1302
1bf808b67403
Set 'letzte_aenderung' to be no insertable. Use database default now() as initial value.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1215
diff
changeset
|
28 @Column(name="letzte_aenderung", insertable=false) |
1097
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
29 private Timestamp letzteAenderung; |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
30 |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
31 @Column(name="ort_id") |
1215
6e393b614edf
The referencing column does not need to be wider than what it refereces.
Tom Gottfried <tom@intevation.de>
parents:
1135
diff
changeset
|
32 private Integer ortId; |
1097
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
33 |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
34 @Column(name="ortszuordnung_typ") |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
35 private String ortszuordnungTyp; |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
36 |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
37 private String ortszusatztext; |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
38 |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
39 @Column(name="probe_id") |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
40 private Integer probeId; |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
41 |
1135
f84b4fb82061
Let the database control the tree_modified column (disable insert and update)
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1097
diff
changeset
|
42 @Column(name="tree_modified", insertable=false, updatable=false) |
1097
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
43 private Timestamp treeModified; |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
44 |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
45 @OneToOne |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
46 @JoinColumn(name="probe_id", insertable=false, updatable=false) |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
47 private Probe probe; |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
48 |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
49 @Transient |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
50 private boolean owner; |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
51 |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
52 @Transient |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
53 private boolean readonly; |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
54 |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
55 @Transient |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
56 private Timestamp parentModified; |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
57 |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
58 public Ortszuordnung() { |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
59 } |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
60 |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
61 public Integer getId() { |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
62 return this.id; |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
63 } |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
64 |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
65 public void setId(Integer id) { |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
66 this.id = id; |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
67 } |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
68 |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
69 public Timestamp getLetzteAenderung() { |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
70 return this.letzteAenderung; |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
71 } |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
72 |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
73 public void setLetzteAenderung(Timestamp letzteAenderung) { |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
74 this.letzteAenderung = letzteAenderung; |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
75 } |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
76 |
1215
6e393b614edf
The referencing column does not need to be wider than what it refereces.
Tom Gottfried <tom@intevation.de>
parents:
1135
diff
changeset
|
77 public Integer getOrtId() { |
1097
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
78 return this.ortId; |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
79 } |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
80 |
1215
6e393b614edf
The referencing column does not need to be wider than what it refereces.
Tom Gottfried <tom@intevation.de>
parents:
1135
diff
changeset
|
81 public void setOrtId(Integer ortId) { |
1097
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
82 this.ortId = ortId; |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
83 } |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
84 |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
85 public String getOrtszuordnungTyp() { |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
86 return this.ortszuordnungTyp; |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
87 } |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
88 |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
89 public void setOrtszuordnungTyp(String ortszuordnungTyp) { |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
90 this.ortszuordnungTyp = ortszuordnungTyp; |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
91 } |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
92 |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
93 public String getOrtszusatztext() { |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
94 return this.ortszusatztext; |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
95 } |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
96 |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
97 public void setOrtszusatztext(String ortszusatztext) { |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
98 this.ortszusatztext = ortszusatztext; |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
99 } |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
100 |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
101 public Integer getProbeId() { |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
102 return this.probeId; |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
103 } |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
104 |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
105 public void setProbeId(Integer probeId) { |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
106 this.probeId = probeId; |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
107 } |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
108 |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
109 public Timestamp getTreeModified() { |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
110 return this.treeModified; |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
111 } |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
112 |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
113 public void setTreeModified(Timestamp treeModified) { |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
114 this.treeModified = treeModified; |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
115 } |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
116 |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
117 /** |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
118 * @return the owner |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
119 */ |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
120 public boolean isOwner() { |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
121 return owner; |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
122 } |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
123 |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
124 /** |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
125 * @param owner the owner to set |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
126 */ |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
127 public void setOwner(boolean owner) { |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
128 this.owner = owner; |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
129 } |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
130 |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
131 /** |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
132 * @return the readonly |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
133 */ |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
134 public boolean isReadonly() { |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
135 return readonly; |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
136 } |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
137 |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
138 /** |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
139 * @param readonly the readonly to set |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
140 */ |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
141 public void setReadonly(boolean readonly) { |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
142 this.readonly = readonly; |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
143 } |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
144 |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
145 public Timestamp getParentModified() { |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
146 if (this.parentModified == null && this.probe != null) { |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
147 return this.probe.getTreeModified(); |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
148 } |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
149 return this.parentModified; |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
150 } |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
151 |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
152 public void setParentModified(Timestamp parentModified) { |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
153 this.parentModified = parentModified; |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
154 } |
186d602e031a
Merged branch schema-update into default.
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
155 } |