annotate flys-backend/src/main/java/de/intevation/flys/model/Waterlevel.java @ 5216:c0bdbe24c115

INFO instead of WARNING for duplicated annotations
author Tom Gottfried <tom@intevation.de>
date Mon, 11 Mar 2013 13:22:50 +0100
parents fb0a5285fe26
children
rev   line source
5208
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
1 package de.intevation.flys.model;
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
2
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
3 import java.io.Serializable;
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
4 import java.util.List;
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
5
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
6 import javax.persistence.Entity;
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
7 import javax.persistence.Id;
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
8 import javax.persistence.Table;
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
9 import javax.persistence.GeneratedValue;
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
10 import javax.persistence.Column;
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
11 import javax.persistence.SequenceGenerator;
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
12 import javax.persistence.GenerationType;
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
13 import javax.persistence.JoinColumn;
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
14 import javax.persistence.OneToOne;
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
15 import javax.persistence.OneToMany;
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
16
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
17 import org.apache.log4j.Logger;
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
18
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
19
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
20
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
21 /** Mapped Waterlevel. */
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
22 @Entity
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
23 @Table(name = "waterlevel")
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
24 public class Waterlevel
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
25 implements Serializable
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
26 {
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
27 private static Logger logger = Logger.getLogger(Waterlevel.class);
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
28
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
29 private Integer id;
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
30
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
31 private River river;
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
32
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
33 private Unit unit;
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
34
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
35 private String description;
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
36
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
37 private List<WaterlevelQRange> qRanges;
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
38
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
39
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
40 public Waterlevel() {
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
41 }
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
42
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
43 public Waterlevel(River river, Unit unit) {
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
44 this.river = river;
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
45 this.unit = unit;
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
46 }
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
47
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
48 public Waterlevel(River river, Unit unit, String description) {
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
49 this(river, unit);
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
50 this.description = description;
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
51 }
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
52
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
53 @Id
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
54 @SequenceGenerator(
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
55 name = "SEQUENCE_WATERLEVEL_ID_SEQ",
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
56 sequenceName = "WATERLEVEL_ID_SEQ",
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
57 allocationSize = 1)
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
58 @GeneratedValue(
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
59 strategy = GenerationType.SEQUENCE,
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
60 generator = "SEQUENCE_WATERLEVEL_ID_SEQ")
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
61 @Column(name = "id")
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
62 public Integer getId() {
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
63 return id;
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
64 }
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
65
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
66 public void setId(Integer id) {
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
67 this.id = id;
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
68 }
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
69
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
70 @OneToOne
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
71 @JoinColumn(name = "river_id" )
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
72 public River getRiver() {
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
73 return river;
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
74 }
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
75
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
76 public void setRiver(River river) {
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
77 this.river = river;
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
78 }
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
79
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
80 @OneToOne
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
81 @JoinColumn(name = "unit_id")
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
82 public Unit getUnit() {
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
83 return unit;
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
84 }
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
85
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
86 public void setUnit(Unit unit) {
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
87 this.unit = unit;
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
88 }
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
89
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
90 @Column(name = "description")
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
91 public String getDescription() {
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
92 return description;
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
93 }
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
94
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
95 public void setDescription(String description) {
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
96 this.description = description;
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
97 }
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
98
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
99 @OneToMany
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
100 @JoinColumn(name="waterlevel_id")
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
101 public List<WaterlevelQRange> getQRanges() {
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
102 return qRanges;
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
103 }
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
104
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
105 public void setQRanges(List<WaterlevelQRange> qRanges) {
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
106 this.qRanges = qRanges;
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
107 }
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
108
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
109 public void addQRange(WaterlevelQRange qRange) {
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
110 qRanges.add(qRange);
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
111 }
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
112 }
fb0a5285fe26 Revert revision 5203
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
113 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org