Mercurial > dive4elements > river
changeset 6355:d6ae01d6a7cb
Backend: Added one to many getter to fetch the official lines associated with a namend main value.
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Mon, 17 Jun 2013 21:49:31 +0200 |
parents | 626af4af74a5 |
children | 4c791a458305 |
files | backend/src/main/java/org/dive4elements/river/model/NamedMainValue.java |
diffstat | 1 files changed, 13 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/backend/src/main/java/org/dive4elements/river/model/NamedMainValue.java Mon Jun 17 17:39:42 2013 +0200 +++ b/backend/src/main/java/org/dive4elements/river/model/NamedMainValue.java Mon Jun 17 21:49:31 2013 +0200 @@ -13,6 +13,7 @@ import javax.persistence.Entity; import javax.persistence.Id; +import javax.persistence.OneToMany; import javax.persistence.Table; import javax.persistence.GeneratedValue; import javax.persistence.Column; @@ -33,6 +34,8 @@ private String name; private MainValueType type; + private List<OfficialLine> officialLines; + public NamedMainValue() { } @@ -77,6 +80,16 @@ this.type = type; } + @OneToMany + @JoinColumn(name = "named_main_value_id") + public List<OfficialLine> getOfficialLines() { + return officialLines; + } + + public void setOfficialLines(List<OfficialLine> officialLines) { + this.officialLines = officialLines; + } + public static NamedMainValue fetchByName(String name, Session session) { Query query = session.createQuery( "from NamedMainValue where name=:name");