Mercurial > lada > lada-server
comparison src/main/java/de/intevation/lada/model/land/Messprogramm.java @ 1019:e192feaf916f
Introduce default value vor Messregime in Messprogramm.
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Tue, 05 Jul 2016 18:24:55 +0200 |
parents | ce1ec3cbde54 |
children | a435b9fd1d85 |
comparison
equal
deleted
inserted
replaced
991:ce1ec3cbde54 | 1019:e192feaf916f |
---|---|
14 import javax.persistence.Entity; | 14 import javax.persistence.Entity; |
15 import javax.persistence.GeneratedValue; | 15 import javax.persistence.GeneratedValue; |
16 import javax.persistence.GenerationType; | 16 import javax.persistence.GenerationType; |
17 import javax.persistence.Id; | 17 import javax.persistence.Id; |
18 import javax.persistence.Table; | 18 import javax.persistence.Table; |
19 import javax.persistence.PrePersist; | |
19 | 20 |
20 | 21 |
21 /** | 22 /** |
22 * The persistent class for the messprogramm database table. | 23 * The persistent class for the messprogramm database table. |
23 */ | 24 */ |
24 @Entity | 25 @Entity |
25 @Table(name="messprogramm") | 26 @Table(name="messprogramm") |
26 public class Messprogramm implements Serializable { | 27 public class Messprogramm implements Serializable { |
27 private static final long serialVersionUID = 1L; | 28 private static final long serialVersionUID = 1L; |
28 | 29 |
30 // Has to be kept in sync with database schema | |
31 @PrePersist | |
32 void setDefaults() { | |
33 if (baId == null) { | |
34 baId = 1; | |
35 } | |
36 } | |
37 | |
29 @Id | 38 @Id |
30 @GeneratedValue(strategy=GenerationType.IDENTITY) | 39 @GeneratedValue(strategy=GenerationType.IDENTITY) |
31 @Column(name="id", unique=true, nullable=false) | 40 @Column(name="id", unique=true, nullable=false) |
32 private Integer id; | 41 private Integer id; |
33 | 42 |