# HG changeset patch # User Sascha L. Teichmann # Date 1371498571 -7200 # Node ID d6ae01d6a7cb5bcfc267524bdc7c0f170bcf5c8a # Parent 626af4af74a590c73dab75d516fee814fb304c46 Backend: Added one to many getter to fetch the official lines associated with a namend main value. diff -r 626af4af74a5 -r d6ae01d6a7cb backend/src/main/java/org/dive4elements/river/model/NamedMainValue.java --- 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 officialLines; + public NamedMainValue() { } @@ -77,6 +80,16 @@ this.type = type; } + @OneToMany + @JoinColumn(name = "named_main_value_id") + public List getOfficialLines() { + return officialLines; + } + + public void setOfficialLines(List officialLines) { + this.officialLines = officialLines; + } + public static NamedMainValue fetchByName(String name, Session session) { Query query = session.createQuery( "from NamedMainValue where name=:name");