|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.pow2.dao.AbstractDAO
com.pow2.dao.IdGenerator
IdGenerator class.
Use the HIGH/LOW approach to generate an
uinque Id.
This method uses the app_identifier database table
| field name | field type | is key ? |
| id | integer not null | y |
| high | integer | n |
INSERT INTO "app_identifier" VALUES (0,1);
| Field Summary | |
static int |
LOW_MAXVALUE
low max value |
| Fields inherited from class com.pow2.dao.AbstractDAO |
cat |
| Constructor Summary | |
protected |
IdGenerator()
Protected default constructor. |
| Method Summary | |
long |
getHigh()
Gets the high attribute of the IdGenerator object |
long |
getId()
Get a new unique identifier number. |
int |
getLow()
Gets the low attribute of the IdGenerator object |
static IdGenerator |
instance()
Get the instance of the IdGenerator class. |
void |
setHigh(long high)
Sets the high attribute of the IdGenerator object |
void |
setLow(int low)
Sets the low attribute of the IdGenerator object |
| Methods inherited from class com.pow2.dao.AbstractDAO |
assertion, closeResources, closeResources, closeResources, count, count, delete, delete, encode, getConnection, getConnection, getNewKey, isDebugEnabled, populate, setLike, setLike |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int LOW_MAXVALUE
| Constructor Detail |
protected IdGenerator()
high and low values.
| Method Detail |
public static IdGenerator instance()
public void setLow(int low)
low - The new low valuepublic int getLow()
public void setHigh(long high)
high - The new high valuepublic long getHigh()
public long getId()
throws Exception
Exception - Description of the Exception
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||