Mercurial > dive4elements > river
annotate flys-backend/src/main/java/de/intevation/flys/model/HydrBoundaryPoly.java @ 5590:b75005269a6c
Datacage: Fix potential connection leak to SedDB.
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Mon, 08 Apr 2013 12:07:43 +0200 |
parents | 87dab419b924 |
children |
rev | line source |
---|---|
2868
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.model; |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
2 |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
3 import java.io.Serializable; |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
4 import java.util.List; |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
5 |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
6 import javax.persistence.Column; |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
7 import javax.persistence.Entity; |
5098
a2600507761e
Add sequences to the new tables that use sequences
Andre Heinecke <aheinecke@intevation.de>
parents:
5089
diff
changeset
|
8 import javax.persistence.GeneratedValue; |
a2600507761e
Add sequences to the new tables that use sequences
Andre Heinecke <aheinecke@intevation.de>
parents:
5089
diff
changeset
|
9 import javax.persistence.GenerationType; |
2868
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
10 import javax.persistence.Id; |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
11 import javax.persistence.JoinColumn; |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
12 import javax.persistence.OneToOne; |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
13 import javax.persistence.Table; |
5098
a2600507761e
Add sequences to the new tables that use sequences
Andre Heinecke <aheinecke@intevation.de>
parents:
5089
diff
changeset
|
14 import javax.persistence.SequenceGenerator; |
2868
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
15 |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
16 import org.hibernate.Session; |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
17 import org.hibernate.Query; |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
18 import org.hibernate.annotations.Type; |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
19 |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
20 import com.vividsolutions.jts.geom.Geometry; |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
21 |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
22 import de.intevation.flys.backend.SessionHolder; |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
23 |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
24 |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
25 @Entity |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
26 @Table(name = "hydr_boundaries_poly") |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
27 public class HydrBoundaryPoly |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
28 implements Serializable |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
29 { |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
30 private Integer id; |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
31 private String name; |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
32 private River river; |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
33 private Geometry geom; |
5062
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
34 private SectieKind sectie; |
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
35 private SobekKind sobek; |
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
36 private BoundaryKind kind; |
2868
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
37 |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
38 public HydrBoundaryPoly() { |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
39 } |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
40 |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
41 |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
42 @Id |
5098
a2600507761e
Add sequences to the new tables that use sequences
Andre Heinecke <aheinecke@intevation.de>
parents:
5089
diff
changeset
|
43 @SequenceGenerator( |
a2600507761e
Add sequences to the new tables that use sequences
Andre Heinecke <aheinecke@intevation.de>
parents:
5089
diff
changeset
|
44 name = "SEQUENCE_HYDR_BOUNDARIES_POLY_ID_SEQ", |
a2600507761e
Add sequences to the new tables that use sequences
Andre Heinecke <aheinecke@intevation.de>
parents:
5089
diff
changeset
|
45 sequenceName = "HYDR_BOUNDARIES_POLY_ID_SEQ", |
a2600507761e
Add sequences to the new tables that use sequences
Andre Heinecke <aheinecke@intevation.de>
parents:
5089
diff
changeset
|
46 allocationSize = 1) |
a2600507761e
Add sequences to the new tables that use sequences
Andre Heinecke <aheinecke@intevation.de>
parents:
5089
diff
changeset
|
47 @GeneratedValue( |
a2600507761e
Add sequences to the new tables that use sequences
Andre Heinecke <aheinecke@intevation.de>
parents:
5089
diff
changeset
|
48 strategy = GenerationType.SEQUENCE, |
a2600507761e
Add sequences to the new tables that use sequences
Andre Heinecke <aheinecke@intevation.de>
parents:
5089
diff
changeset
|
49 generator = "SEQUENCE_HYDR_BOUNDARIES_POLY_ID_SEQ") |
2868
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
50 @Column(name = "id") |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
51 public Integer getId() { |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
52 return id; |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
53 } |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
54 |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
55 |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
56 public void setId(Integer id) { |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
57 this.id = id; |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
58 } |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
59 |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
60 |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
61 @OneToOne |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
62 @JoinColumn(name = "river_id") |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
63 public River getRiver() { |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
64 return river; |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
65 } |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
66 |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
67 |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
68 public void setRiver(River river) { |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
69 this.river = river; |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
70 } |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
71 |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
72 |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
73 @Column(name = "name") |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
74 public String getName() { |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
75 return name; |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
76 } |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
77 |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
78 |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
79 public void setName(String name) { |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
80 this.name = name; |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
81 } |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
82 |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
83 |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
84 @Column(name = "geom") |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
85 @Type(type = "org.hibernatespatial.GeometryUserType") |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
86 public Geometry getGeom() { |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
87 return geom; |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
88 } |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
89 |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
90 |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
91 public void setGeom(Geometry geom) { |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
92 this.geom = geom; |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
93 } |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
94 |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
95 |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
96 public static List<HydrBoundaryPoly> getHydrBoundaries(int riverId, String name) { |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
97 Session session = SessionHolder.HOLDER.get(); |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
98 |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
99 Query query = session.createQuery( |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
100 "from HydrBoundaryPoly where river.id =:river_id and name=:name"); |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
101 query.setParameter("river_id", riverId); |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
102 query.setParameter("name", name); |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
103 |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
104 return query.list(); |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
105 } |
5062
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
106 |
5515
87dab419b924
Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents:
5098
diff
changeset
|
107 public static List<HydrBoundaryPoly> getHydrBoundaries(int riverId, |
87dab419b924
Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents:
5098
diff
changeset
|
108 int kind, int sectie, int sobek) { |
87dab419b924
Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents:
5098
diff
changeset
|
109 Session session = SessionHolder.HOLDER.get(); |
87dab419b924
Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents:
5098
diff
changeset
|
110 |
87dab419b924
Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents:
5098
diff
changeset
|
111 String filter = " where river.id =:river_id"; |
87dab419b924
Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents:
5098
diff
changeset
|
112 |
87dab419b924
Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents:
5098
diff
changeset
|
113 if (kind != -1) { |
87dab419b924
Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents:
5098
diff
changeset
|
114 filter += " and kind = " + kind; |
87dab419b924
Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents:
5098
diff
changeset
|
115 } |
87dab419b924
Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents:
5098
diff
changeset
|
116 if (sectie != -1) { |
87dab419b924
Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents:
5098
diff
changeset
|
117 filter += " and sectie = " + sectie; |
87dab419b924
Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents:
5098
diff
changeset
|
118 } |
87dab419b924
Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents:
5098
diff
changeset
|
119 if (sobek != -1){ |
87dab419b924
Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents:
5098
diff
changeset
|
120 filter += " and sobek = " + sobek; |
87dab419b924
Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents:
5098
diff
changeset
|
121 } |
87dab419b924
Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents:
5098
diff
changeset
|
122 |
87dab419b924
Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents:
5098
diff
changeset
|
123 Query query = session.createQuery("from HydrBoundaryPoly" + filter); |
87dab419b924
Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents:
5098
diff
changeset
|
124 query.setParameter("river_id", riverId); |
87dab419b924
Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents:
5098
diff
changeset
|
125 return query.list(); |
87dab419b924
Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents:
5098
diff
changeset
|
126 } |
87dab419b924
Properly handle hydr_boundaries and hydr_boundaries_poly in datacage
Andre Heinecke <aheinecke@intevation.de>
parents:
5098
diff
changeset
|
127 |
5062
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
128 /** |
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
129 * Get sectie. |
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
130 * |
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
131 * @return sectie as SectieKind. |
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
132 */ |
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
133 @OneToOne |
5089
4e03f3976d4b
Fix column decorator for sectie
Andre Heinecke <aheinecke@intevation.de>
parents:
5062
diff
changeset
|
134 @JoinColumn(name = "sectie") |
5062
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
135 public SectieKind getSectie() |
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
136 { |
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
137 return sectie; |
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
138 } |
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
139 |
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
140 /** |
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
141 * Set sectie. |
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
142 * |
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
143 * @param sectie the value to set. |
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
144 */ |
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
145 public void setSectie(SectieKind sectie) |
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
146 { |
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
147 this.sectie = sectie; |
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
148 } |
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
149 |
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
150 /** |
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
151 * Get sobek. |
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
152 * |
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
153 * @return sobek as SobekKind. |
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
154 */ |
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
155 @OneToOne |
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
156 @JoinColumn(name = "sobek") |
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
157 public SobekKind getSobek() |
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
158 { |
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
159 return sobek; |
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
160 } |
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
161 |
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
162 /** |
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
163 * Set sobek. |
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
164 * |
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
165 * @param sobek the value to set. |
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
166 */ |
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
167 public void setSobek(SobekKind sobek) |
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
168 { |
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
169 this.sobek = sobek; |
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
170 } |
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
171 |
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
172 /** |
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
173 * Get kind. |
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
174 * |
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
175 * @return kind as BoundaryKind. |
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
176 */ |
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
177 @OneToOne |
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
178 @JoinColumn(name = "kind") |
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
179 public BoundaryKind getKind() |
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
180 { |
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
181 return kind; |
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
182 } |
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
183 |
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
184 /** |
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
185 * Set kind. |
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
186 * |
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
187 * @param kind the value to set. |
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
188 */ |
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
189 public void setKind(BoundaryKind kind) |
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
190 { |
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
191 this.kind = kind; |
bafc655ee630
Add kind, sectie and sobek to HydrBoundary class
Andre Heinecke <aheinecke@intevation.de>
parents:
2868
diff
changeset
|
192 } |
2868
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
193 } |
b6f94c5db89e
Added HydrBoundary and HydrBoundaryPoly and adapted method signatures of Line and Building.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
194 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |