Mercurial > dive4elements > river
annotate backend/src/main/java/org/dive4elements/river/model/uinfo/Vegetation.java @ 9038:4c5eeaff554c
Database column "comment" renamed to "notes" (restrictions in Oracle)
author | mschaefer |
---|---|
date | Wed, 02 May 2018 06:56:21 +0200 |
parents | 201817aa7b1c |
children | 361de818f76e |
rev | line source |
---|---|
9014 | 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.GeneratedValue; | |
20 import javax.persistence.GenerationType; | |
21 import javax.persistence.Id; | |
22 import javax.persistence.JoinColumn; | |
23 import javax.persistence.OneToMany; | |
24 import javax.persistence.OneToOne; | |
25 import javax.persistence.SequenceGenerator; | |
26 import javax.persistence.Table; | |
27 | |
28 import org.dive4elements.river.model.River; | |
29 | |
30 /** | |
31 * Hibernate binding for the DB table vegetation | |
32 * | |
33 * @author Matthias Schäfer | |
34 * | |
35 */ | |
36 | |
37 @Entity | |
38 @Table(name = "vegetation") | |
39 public class Vegetation implements Serializable { | |
40 | |
41 /***** FIELDS *****/ | |
42 | |
43 private static final long serialVersionUID = -2264657956270172835L; | |
44 | |
45 private Integer id; | |
46 | |
47 private River river; | |
48 | |
49 private String filename; | |
50 | |
51 private String name; | |
52 | |
9038
4c5eeaff554c
Database column "comment" renamed to "notes" (restrictions in Oracle)
mschaefer
parents:
9014
diff
changeset
|
53 private String notes; |
9014 | 54 |
55 private List<VegetationZone> values; | |
56 | |
57 | |
58 /***** CONSTRUCTORS *****/ | |
59 | |
60 public Vegetation() { | |
61 } | |
62 | |
63 | |
9038
4c5eeaff554c
Database column "comment" renamed to "notes" (restrictions in Oracle)
mschaefer
parents:
9014
diff
changeset
|
64 public Vegetation(final River river, final String filename, final String name, final String notes) { |
9014 | 65 this.river = river; |
66 this.filename = filename; | |
67 this.name = name; | |
9038
4c5eeaff554c
Database column "comment" renamed to "notes" (restrictions in Oracle)
mschaefer
parents:
9014
diff
changeset
|
68 this.notes = notes; |
9014 | 69 this.values = new ArrayList<>(); |
70 } | |
71 | |
72 /***** METHODS *****/ | |
73 | |
74 @Id | |
75 @SequenceGenerator(name = "SEQUENCE_VEGETATION_ID_SEQ", sequenceName = "VEGETATION_ID_SEQ", allocationSize = 1) | |
76 @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQUENCE_VEGETATION_ID_SEQ") | |
77 @Column(name = "id") | |
78 public Integer getId() { | |
79 return this.id; | |
80 } | |
81 | |
82 public void setId(final Integer id) { | |
83 this.id = id; | |
84 } | |
85 | |
86 @OneToOne | |
87 @JoinColumn(name = "river_id") | |
88 public River getRiver() { | |
89 return this.river; | |
90 } | |
91 | |
92 public void setRiver(final River river) { | |
93 this.river = river; | |
94 } | |
95 | |
96 @Column(name = "filename") | |
97 public String getFilename() { | |
98 return this.filename; | |
99 } | |
100 | |
101 public void setFilename(final String filename) { | |
102 this.filename = filename; | |
103 } | |
104 | |
105 @Column(name = "name") | |
106 public String getName() { | |
107 return this.name; | |
108 } | |
109 | |
110 public void setName(final String name) { | |
111 this.name = name; | |
112 } | |
113 | |
9038
4c5eeaff554c
Database column "comment" renamed to "notes" (restrictions in Oracle)
mschaefer
parents:
9014
diff
changeset
|
114 @Column(name = "notes") |
4c5eeaff554c
Database column "comment" renamed to "notes" (restrictions in Oracle)
mschaefer
parents:
9014
diff
changeset
|
115 public String getNotes() { |
4c5eeaff554c
Database column "comment" renamed to "notes" (restrictions in Oracle)
mschaefer
parents:
9014
diff
changeset
|
116 return this.notes; |
9014 | 117 } |
118 | |
9038
4c5eeaff554c
Database column "comment" renamed to "notes" (restrictions in Oracle)
mschaefer
parents:
9014
diff
changeset
|
119 public void setNotes(final String notes) { |
4c5eeaff554c
Database column "comment" renamed to "notes" (restrictions in Oracle)
mschaefer
parents:
9014
diff
changeset
|
120 this.notes = notes; |
9014 | 121 } |
122 | |
123 @OneToMany | |
124 @JoinColumn(name = "vegetation_id") | |
125 public List<VegetationZone> getValues() { | |
126 return this.values; | |
127 } | |
128 | |
129 public void setValues(final List<VegetationZone> values) { | |
130 this.values = values; | |
131 } | |
132 | |
133 public void addValue(final VegetationZone value) { | |
134 this.values.add(value); | |
135 } | |
136 } |