Mercurial > lada > lada-server
comparison src/main/java/de/intevation/lada/model/stamm/LadaUser.java @ 855:36b1104c3c22
Updated model for query, filter, result, etc.
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Tue, 02 Feb 2016 15:29:09 +0100 |
parents | 2b9fd00bca56 |
children |
comparison
equal
deleted
inserted
replaced
853:2ce24e2baf20 | 855:36b1104c3c22 |
---|---|
8 package de.intevation.lada.model.stamm; | 8 package de.intevation.lada.model.stamm; |
9 | 9 |
10 import java.io.Serializable; | 10 import java.io.Serializable; |
11 import java.util.List; | 11 import java.util.List; |
12 | 12 |
13 import javax.persistence.Column; | |
13 import javax.persistence.Entity; | 14 import javax.persistence.Entity; |
15 import javax.persistence.FetchType; | |
16 import javax.persistence.GeneratedValue; | |
17 import javax.persistence.GenerationType; | |
14 import javax.persistence.Id; | 18 import javax.persistence.Id; |
15 import javax.persistence.OneToMany; | 19 import javax.persistence.OneToMany; |
16 import javax.persistence.Table; | 20 import javax.persistence.Table; |
17 | 21 |
18 | 22 |
24 @Table(name="lada_user") | 28 @Table(name="lada_user") |
25 public class LadaUser implements Serializable { | 29 public class LadaUser implements Serializable { |
26 private static final long serialVersionUID = 1L; | 30 private static final long serialVersionUID = 1L; |
27 | 31 |
28 @Id | 32 @Id |
33 @GeneratedValue(strategy=GenerationType.IDENTITY) | |
34 @Column(name="id", unique=true, nullable=false) | |
29 private Integer id; | 35 private Integer id; |
30 | 36 |
31 private String name; | 37 private String name; |
32 | |
33 //bi-directional many-to-one association to Favorite | |
34 @OneToMany(mappedBy="ladaUser") | |
35 private List<Favorite> favorites; | |
36 | |
37 //bi-directional many-to-one association to FilterValue | |
38 @OneToMany(mappedBy="ladaUser") | |
39 private List<FilterValue> filterValues; | |
40 | 38 |
41 public LadaUser() { | 39 public LadaUser() { |
42 } | 40 } |
43 | 41 |
44 public Integer getId() { | 42 public Integer getId() { |
54 } | 52 } |
55 | 53 |
56 public void setName(String name) { | 54 public void setName(String name) { |
57 this.name = name; | 55 this.name = name; |
58 } | 56 } |
59 | |
60 public List<Favorite> getFavorites() { | |
61 return this.favorites; | |
62 } | |
63 | |
64 public void setFavorites(List<Favorite> favorites) { | |
65 this.favorites = favorites; | |
66 } | |
67 | |
68 public Favorite addFavorite(Favorite favorite) { | |
69 getFavorites().add(favorite); | |
70 favorite.setLadaUser(this); | |
71 | |
72 return favorite; | |
73 } | |
74 | |
75 public Favorite removeFavorite(Favorite favorite) { | |
76 getFavorites().remove(favorite); | |
77 favorite.setLadaUser(null); | |
78 | |
79 return favorite; | |
80 } | |
81 | |
82 public List<FilterValue> getFilterValues() { | |
83 return this.filterValues; | |
84 } | |
85 | |
86 public void setFilterValues(List<FilterValue> filterValues) { | |
87 this.filterValues = filterValues; | |
88 } | |
89 | |
90 public FilterValue addFilterValue(FilterValue filterValue) { | |
91 getFilterValues().add(filterValue); | |
92 filterValue.setLadaUser(this); | |
93 | |
94 return filterValue; | |
95 } | |
96 | |
97 public FilterValue removeFilterValue(FilterValue filterValue) { | |
98 getFilterValues().remove(filterValue); | |
99 filterValue.setLadaUser(null); | |
100 | |
101 return filterValue; | |
102 } | |
103 | |
104 } | 57 } |