Mercurial > dive4elements > river
comparison backend/src/main/java/org/dive4elements/river/model/uinfo/SalixRank.java @ 8971:50416a0df385
Importer for the Schifffahrt (S-INFO) and Oekologie (U-INFO) files
author | mschaefer |
---|---|
date | Tue, 03 Apr 2018 10:18:30 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
8970:da5dc7446652 | 8971:50416a0df385 |
---|---|
1 /* Copyright (C) 2017 by Bundesanstalt für Gewässerkunde | |
2 * Software engineering by | |
3 * Björnsen Beratende Ingenieure GmbH | |
4 * Dr. Schumacher Ingenieurbüro für Wasser und Umwelt | |
5 * | |
6 * This file is Free Software under the GNU AGPL (>=v3) | |
7 * and comes with ABSOLUTELY NO WARRANTY! Check out the | |
8 * documentation coming with Dive4Elements River for details. | |
9 */ | |
10 | |
11 package org.dive4elements.river.model.uinfo; | |
12 | |
13 import java.io.Serializable; | |
14 import java.util.ArrayList; | |
15 import java.util.List; | |
16 | |
17 import javax.persistence.Column; | |
18 import javax.persistence.Entity; | |
19 import javax.persistence.Id; | |
20 import javax.persistence.Table; | |
21 | |
22 import org.dive4elements.river.backend.SessionHolder; | |
23 import org.hibernate.Query; | |
24 import org.hibernate.Session; | |
25 | |
26 @Entity | |
27 @Table(name = "salix_rank") | |
28 public class SalixRank implements Serializable { | |
29 | |
30 /***** FIELDS *****/ | |
31 | |
32 private static final long serialVersionUID = 7459539781698086683L; | |
33 | |
34 private Integer id; | |
35 | |
36 private String name; | |
37 | |
38 private Double min_value; | |
39 | |
40 private Double max_value; | |
41 | |
42 | |
43 /***** CONSTRUCTORS *****/ | |
44 | |
45 public SalixRank() { | |
46 } | |
47 | |
48 public SalixRank(final String name) { | |
49 this.name = name; | |
50 } | |
51 | |
52 /***** METHODS *****/ | |
53 | |
54 @Id | |
55 @Column(name = "id") | |
56 public Integer getId() { | |
57 return this.id; | |
58 } | |
59 | |
60 public void setId(final Integer id) { | |
61 this.id = id; | |
62 } | |
63 | |
64 @Column(name = "name") | |
65 public String getName() { | |
66 return this.name; | |
67 } | |
68 | |
69 public void setName(final String name) { | |
70 this.name = name; | |
71 } | |
72 | |
73 @Column(name = "min_value") | |
74 public Double getMin_value() { | |
75 return this.min_value; | |
76 } | |
77 | |
78 public void setMin_value(final Double min_value) { | |
79 this.min_value = min_value; | |
80 } | |
81 | |
82 @Column(name = "max_value") | |
83 public Double getMax_value() { | |
84 return this.max_value; | |
85 } | |
86 | |
87 public void setMax_value(final Double max_value) { | |
88 this.max_value = max_value; | |
89 } | |
90 | |
91 /** | |
92 * Queries all salix ranks from the database, orders by id | |
93 */ | |
94 public static List<SalixRank> getTypes() { | |
95 final Session session = SessionHolder.HOLDER.get(); | |
96 final Query query = session.createQuery("FROM SalixRank ORDER BY id"); | |
97 return new ArrayList<>(query.list()); | |
98 } | |
99 } |