Mercurial > dive4elements > river
comparison flys-backend/src/main/java/de/intevation/flys/model/River.java @ 171:4a83e14f40f9
Added entity and id annotations.
flys-backend/trunk@1463 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Mon, 14 Mar 2011 14:52:58 +0000 |
parents | 7929f4144d2f |
children | 249390dd24e7 |
comparison
equal
deleted
inserted
replaced
170:88c14d5d45be | 171:4a83e14f40f9 |
---|---|
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.Column; | 9 import javax.persistence.Column; |
10 import javax.persistence.SequenceGenerator; | 10 import javax.persistence.SequenceGenerator; |
11 | |
12 import javax.persistence.GenerationType; | 11 import javax.persistence.GenerationType; |
13 | 12 |
14 @Entity | 13 @Entity |
15 @Table(name = "rivers") | 14 @Table(name = "rivers") |
16 public class River | 15 public class River |
20 | 19 |
21 private String name; | 20 private String name; |
22 | 21 |
23 @Id | 22 @Id |
24 @SequenceGenerator( | 23 @SequenceGenerator( |
25 name = "SEQUENCE RIVERS_ID_SEQ", | 24 name = "SEQUENCE_RIVERS_ID_SEQ", |
26 sequenceName = "RIVERS_ID_SEQ", | 25 sequenceName = "RIVERS_ID_SEQ", |
27 allocationSize = 1) | 26 allocationSize = 1) |
28 @GeneratedValue( | 27 @GeneratedValue( |
29 strategy = GenerationType.SEQUENCE, | 28 strategy = GenerationType.SEQUENCE, |
30 generator = "SEQUENCE RIVERS_ID_SEQ") | 29 generator = "SEQUENCE_RIVERS_ID_SEQ") |
31 @Column(name = "id") | 30 @Column(name = "id") |
32 public Integer getId() { | 31 public Integer getId() { |
33 return id; | 32 return id; |
34 } | 33 } |
35 | 34 |