01: //$Id: Simple06.java 7 2007-08-17 19:32:18Z jcamaia $
02:
03: package net.sf.persist.tests.common;
04:
05: import net.sf.persist.annotations.Column;
06: import net.sf.persist.annotations.Table;
07:
08: @Table(name="simple")
09: public class Simple06 {
10:
11: private long id;
12: private String stringCol;
13: private long intCol;
14:
15: // only setter annotated -- ok
16: public long getId() {
17: return id;
18: }
19:
20: @Column(autoGenerated=true)
21: public void setId(long id) {
22: this .id = id;
23: }
24:
25: // annotations for getter and setter are the same -- ok
26: @Column(name="string_col",autoGenerated=false)
27: public String getStringCol() {
28: return stringCol;
29: }
30:
31: @Column(autoGenerated=false,name="string_col")
32: public void setStringCol(String stringCol) {
33: this .stringCol = stringCol;
34: }
35:
36: // annotations for getter and setter are different -- will blow
37: @Column(name="int_col")
38: public long getIntCol() {
39: return intCol;
40: }
41:
42: @Column(name="col_int")
43: public void setIntCol(long intCol) {
44: this.intCol = intCol;
45: }
46:
47: }
|