KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > nightlabs > ipanema > idgenerator > IDStoreLong


1 /*
2  * Created on 18.03.2004
3  */

4 package com.nightlabs.ipanema.idgenerator;
5
6 /**
7  * @author marco
8  */

9
10 /**
11  * @jdo.persistence-capable
12  * identity-type = "application"
13  * objectid-class = "IDStoreLongID"
14  * detachable = "true"
15  *
16  * @jdo.inheritance strategy = "new-table"
17  */

18
19 public class IDStoreLong {
20
21     protected IDStoreLong() { }
22     
23     public IDStoreLong(String JavaDoc _key)
24     {
25         this.key = _key;
26         this.lastID = 0;
27     }
28     
29     /**
30      * @jdo.field persistence-modifier="persistent" primary-key="true"
31      * @jdo.column length="100"
32      */

33     private String JavaDoc key;
34     
35     /**
36      * @jdo.field persistence-modifier="persistent"
37      */

38     private long lastID;
39     
40
41     /**
42      * @return Returns the value.
43      */

44     public long getLastID() {
45         return lastID;
46     }
47
48     public void increment() {
49         ++lastID;
50     }
51
52     /**
53      * @return Returns the key.
54      */

55     public String JavaDoc getKey() {
56         return key;
57     }
58
59 }
60
Popular Tags