Mercurial > dive4elements > river
comparison flys-backend/src/main/java/de/intevation/flys/model/River.java @ 168:86a1bd9cc50e
More Hibernate/JPA stuff
flys-backend/trunk@1458 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Fri, 11 Mar 2011 14:41:18 +0000 |
parents | 15d515fe15f5 |
children | 7929f4144d2f |
comparison
equal
deleted
inserted
replaced
167:15d515fe15f5 | 168:86a1bd9cc50e |
---|---|
1 package de.intevation.flys.model; | 1 package de.intevation.flys.model; |
2 | 2 |
3 import java.io.Serializable; | 3 import java.io.Serializable; |
4 | 4 |
5 import javax.persistence.Entity; | |
6 import javax.persistence.Id; | |
7 import javax.persistence.Table; | |
8 import javax.persistence.GeneratedValue; | |
9 import javax.persistence.Column; | |
10 import javax.persistence.SequenceGenerator; | |
11 | |
12 import javax.persistence.GenerationType; | |
13 | |
14 @Entity | |
15 @Table(name = "rivers") | |
5 public class River | 16 public class River |
6 implements Serializable | 17 implements Serializable |
7 { | 18 { |
8 private Long id; | 19 private Integer id; |
9 | 20 |
10 private String name; | 21 private String name; |
11 | 22 |
12 public void setId(Long id) { | 23 @Id |
24 @SequenceGenerator( | |
25 name = "SEQUENCE RIVERS_ID_SEQ", | |
26 sequenceName = "RIVERS_ID_SEQ") | |
27 @GeneratedValue( | |
28 strategy = GenerationType.SEQUENCE, | |
29 generator = "SEQUENCE RIVERS_ID_SEQ") | |
30 @Column(name = "id") | |
31 public Integer getId() { | |
32 return id; | |
33 } | |
34 | |
35 public void setId(Integer id) { | |
13 this.id = id; | 36 this.id = id; |
14 } | 37 } |
15 | 38 |
16 public Long getId() { | 39 @Column(name = "name") |
17 return id; | 40 public String getName() { |
41 return name; | |
18 } | 42 } |
19 | 43 |
20 public void setName(String name) { | 44 public void setName(String name) { |
21 this.name = name; | 45 this.name = name; |
22 } | 46 } |
23 | 47 |
24 public String getName() { | |
25 return name; | |
26 } | |
27 | |
28 public River() { | 48 public River() { |
29 } | 49 } |
30 } | 50 } |
31 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 51 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |