Mercurial > dive4elements > river
comparison flys-backend/src/main/java/de/intevation/flys/model/Fixpoint.java @ 2366:2246348ff90e
Added functions that return lists of Buildings/Fixpoints to according classes.
flys-backend/trunk@3223 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Thu, 10 Nov 2011 13:58:33 +0000 |
parents | e2deda3b77a7 |
children |
comparison
equal
deleted
inserted
replaced
2365:60532f75396b | 2366:2246348ff90e |
---|---|
1 package de.intevation.flys.model; | 1 package de.intevation.flys.model; |
2 | 2 |
3 import java.io.Serializable; | 3 import java.io.Serializable; |
4 import java.math.BigDecimal; | 4 import java.math.BigDecimal; |
5 import java.util.List; | |
5 | 6 |
6 import javax.persistence.Column; | 7 import javax.persistence.Column; |
7 import javax.persistence.Entity; | 8 import javax.persistence.Entity; |
8 import javax.persistence.Id; | 9 import javax.persistence.Id; |
9 import javax.persistence.JoinColumn; | 10 import javax.persistence.JoinColumn; |
10 import javax.persistence.OneToOne; | 11 import javax.persistence.OneToOne; |
11 import javax.persistence.Table; | 12 import javax.persistence.Table; |
12 | 13 |
14 import org.hibernate.Session; | |
15 import org.hibernate.Query; | |
13 import org.hibernate.annotations.Type; | 16 import org.hibernate.annotations.Type; |
14 | 17 |
15 import com.vividsolutions.jts.geom.Point; | 18 import com.vividsolutions.jts.geom.Point; |
19 | |
20 import de.intevation.flys.backend.SessionHolder; | |
16 | 21 |
17 | 22 |
18 @Entity | 23 @Entity |
19 @Table(name = "fixpoints") | 24 @Table(name = "fixpoints") |
20 public class Fixpoint | 25 public class Fixpoint |
108 | 113 |
109 | 114 |
110 public void setGeom(Point geom) { | 115 public void setGeom(Point geom) { |
111 this.geom = geom; | 116 this.geom = geom; |
112 } | 117 } |
118 | |
119 | |
120 public static List<Fixpoint> getFixpoints(int riverId) { | |
121 Session session = SessionHolder.HOLDER.get(); | |
122 | |
123 Query query = session.createQuery( | |
124 "from Fixpoint where river.id =:river_id"); | |
125 query.setParameter("river_id", riverId); | |
126 | |
127 return query.list(); | |
128 } | |
113 } | 129 } |
114 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 130 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |