Mercurial > dive4elements > river
comparison flys-backend/src/main/java/de/intevation/flys/model/SQRelationValue.java @ 3329:cc8fc6b29649
Store sq relations into database after parsing.
flys-backend/trunk@4647 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Wed, 13 Jun 2012 08:12:00 +0000 |
parents | 6b94700ccf05 |
children | 13596605e81f |
comparison
equal
deleted
inserted
replaced
3328:a41f279a66e2 | 3329:cc8fc6b29649 |
---|---|
4 | 4 |
5 import javax.persistence.Entity; | 5 import javax.persistence.Entity; |
6 import javax.persistence.Id; | 6 import javax.persistence.Id; |
7 import javax.persistence.Table; | 7 import javax.persistence.Table; |
8 import javax.persistence.GeneratedValue; | 8 import javax.persistence.GeneratedValue; |
9 import javax.persistence.JoinColumn; | |
9 import javax.persistence.Column; | 10 import javax.persistence.Column; |
10 import javax.persistence.SequenceGenerator; | 11 import javax.persistence.SequenceGenerator; |
11 import javax.persistence.OneToOne; | 12 import javax.persistence.OneToOne; |
12 import javax.persistence.GenerationType; | 13 import javax.persistence.GenerationType; |
13 | 14 |
27 private double km; | 28 private double km; |
28 private double a; | 29 private double a; |
29 private double b; | 30 private double b; |
30 | 31 |
31 | 32 |
33 protected SQRelationValue() { | |
34 } | |
35 | |
36 | |
37 public SQRelationValue( | |
38 SQRelation sqRelation, | |
39 String parameter, | |
40 String fraction, | |
41 String function, | |
42 double km, | |
43 double a, | |
44 double b | |
45 ) { | |
46 this.sqRelation = sqRelation; | |
47 this.parameter = parameter; | |
48 this.fraction = fraction; | |
49 this.function = function; | |
50 this.km = km; | |
51 this.a = a; | |
52 this.b = b; | |
53 } | |
54 | |
55 | |
32 @Id | 56 @Id |
33 @SequenceGenerator( | 57 @SequenceGenerator( |
34 name = "SEQUENCE_SQ_VALUE_ID_SEQ", | 58 name = "SEQUENCE_SQ_VALUE_ID_SEQ", |
35 sequenceName = "SQ_RELATION_VALUES_ID_SEQ", | 59 sequenceName = "SQ_RELATION_VALUES_ID_SEQ", |
36 allocationSize = 1) | 60 allocationSize = 1) |
45 public void setId(Integer id) { | 69 public void setId(Integer id) { |
46 this.id = id; | 70 this.id = id; |
47 } | 71 } |
48 | 72 |
49 | 73 |
50 //@Column(name = "sq_relation_id") | |
51 @OneToOne | 74 @OneToOne |
52 public SQRelation getSQRelation() { | 75 @JoinColumn(name = "sq_relation_id") |
76 public SQRelation getSqRelation() { | |
53 return sqRelation; | 77 return sqRelation; |
54 } | 78 } |
55 | 79 |
56 public void setSQRelation(SQRelation sqRelation) { | 80 public void setSqRelation(SQRelation sqRelation) { |
57 this.sqRelation = sqRelation; | 81 this.sqRelation = sqRelation; |
58 } | 82 } |
59 | 83 |
60 | 84 |
61 @Column(name = "parameter") | 85 @Column(name = "parameter") |