|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.pain.db.DbObject
Superclass for any persistent PAiNDb object.
Subclass should implement provideSchema method.
Constructor Summary | |
protected |
DbObject()
This constuctor used for database startup time objects instantiation Subclasses should also provide default empty constructor (and not use any get/set methods in it) |
protected |
DbObject(PainDB db)
this contructor used by user in runtime to create new objects if no class instance for this object exists provideSchema methodwill be invoked and DbClass instance created. |
Method Summary | |
void |
delete()
Removes object from database. |
DbArrayList |
getArrayList(int fid)
Note: there is only getter method for Lists. |
boolean |
getBoolean(int fid)
|
byte |
getByte(int fid)
|
byte[] |
getByteArray(int fid)
NOTE: PainDB is not able to track any changes in arrays, user should use getXArrayForRead to avoid copying. |
byte[] |
getByteArrayForRead(int fid)
NOTE: PainDB is not able to track any changes in arrays, this method provides direct access to arrays user should not modify array instance obtained with this method (rollback info could be lost) |
char |
getChar(int fid)
|
char[] |
getCharArray(int fid)
NOTE: PainDB is not able to track any changes in arrays, user should use getXArrayForRead to avoid copying. |
char[] |
getCharArrayForRead(int fid)
NOTE: PainDB is not able to track any changes in arrays, this method provides direct access to arrays user should not modify array instance obtained with this method (rollback info could be lost) |
PainDB |
getDB()
|
DbClass |
getDbClass()
|
double |
getDouble(int fid)
|
float |
getFloat(int fid)
|
int |
getInt(int fid)
|
int[] |
getIntArray(int fid)
NOTE: PainDB is not able to track any changes in arrays, user should use getXArrayForRead to avoid copying. |
int[] |
getIntArrayForRead(int fid)
NOTE: PainDB is not able to track any changes in arrays, this method provides direct access to arrays user should not modify array instance obtained with this method (rollback info could be lost) |
DbIntKeyMap |
getIntKeyMap(int fid)
Note: there is only getter method for Maps. |
DbLinkedList |
getLinkedList(int fid)
Note: there is only getter method for Lists. |
java.util.List |
getList(int fid)
|
long |
getLong(int fid)
|
java.io.Serializable |
getOid()
|
DbObject |
getReference(int fid)
|
DbReferenceSet |
getRefSet(int fid)
Note: there is only getter method for Sets. |
short |
getShort(int fid)
|
java.lang.String |
getString(int fid)
|
java.lang.String[] |
getStringArray(int fid)
NOTE: PainDB is not able to track any changes in arrays, this method provides direct access to arrays user should not modify array instance obtained with this method (rollback info could be lost) |
java.lang.String[] |
getStringArrayForRead(int fid)
NOTE: PainDB is not able to track any changes in arrays, this method provides direct access to arrays user should not modify array instance obtained with this method (rollback info could be lost) |
DbStringKeyMap |
getStringKeyMap(int fid)
Note: there is only getter method for Maps. |
DbStringMap |
getStringMap(int fid)
|
DbStringSet |
getStringSet(int fid)
|
boolean |
isClean()
|
boolean |
isDeleted()
|
boolean |
isDetached()
|
boolean |
isDirty()
|
boolean |
isNew()
|
protected abstract DbClassSchema |
provideSchema()
Every time we add new DbObject of the unknown class to database this method is called. |
void |
setBoolean(int fid,
boolean value)
|
void |
setByte(int fid,
byte value)
|
void |
setByteArray(int fid,
byte[] value)
|
void |
setChar(int fid,
char value)
|
void |
setCharArray(int fid,
char[] value)
|
void |
setDouble(int fid,
double value)
|
void |
setFloat(int fid,
float value)
|
void |
setInt(int fid,
int value)
|
void |
setIntArray(int fid,
int[] value)
|
void |
setLong(int fid,
long value)
|
void |
setReference(int fid,
DbObject value)
|
void |
setShort(int fid,
short value)
|
void |
setString(int fid,
java.lang.String value)
|
void |
setStringArray(int fid,
java.lang.String[] value)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected DbObject()
protected DbObject(PainDB db) throws java.lang.RuntimeException
provideSchema
method
db
-
java.lang.RuntimeException
- (TODO: will be changed to some PAIN RuntimeExceptionImpl)Method Detail |
protected abstract DbClassSchema provideSchema()
public final boolean getBoolean(int fid)
public final byte getByte(int fid)
public final char getChar(int fid)
public final double getDouble(int fid)
public final float getFloat(int fid)
public final int getInt(int fid)
public final long getLong(int fid)
public final short getShort(int fid)
public final DbObject getReference(int fid)
public final java.lang.String getString(int fid)
public final byte[] getByteArray(int fid)
fid
-
public final byte[] getByteArrayForRead(int fid)
fid
-
public final char[] getCharArray(int fid)
fid
-
public final char[] getCharArrayForRead(int fid)
fid
-
public final int[] getIntArray(int fid)
fid
-
public final int[] getIntArrayForRead(int fid)
fid
-
public final java.lang.String[] getStringArray(int fid)
fid
-
public final java.lang.String[] getStringArrayForRead(int fid)
fid
-
public final java.util.List getList(int fid)
public final DbLinkedList getLinkedList(int fid)
fid
- number of field
public final DbArrayList getArrayList(int fid)
fid
- number of field
public final DbIntKeyMap getIntKeyMap(int fid)
fid
- number of field
public final DbStringKeyMap getStringKeyMap(int fid)
fid
- number of field
public final DbReferenceSet getRefSet(int fid)
fid
-
public final DbStringSet getStringSet(int fid)
public final DbStringMap getStringMap(int fid)
public final void setBoolean(int fid, boolean value)
public final void setByte(int fid, byte value)
public final void setChar(int fid, char value)
public final void setDouble(int fid, double value)
public final void setFloat(int fid, float value)
public final void setInt(int fid, int value)
public final void setLong(int fid, long value)
public final void setShort(int fid, short value)
public final void setString(int fid, java.lang.String value)
public final void setReference(int fid, DbObject value)
public final void setByteArray(int fid, byte[] value)
public final void setCharArray(int fid, char[] value)
public final void setStringArray(int fid, java.lang.String[] value)
public final void setIntArray(int fid, int[] value)
public void delete()
public final PainDB getDB()
public final DbClass getDbClass()
public final java.io.Serializable getOid()
public final boolean isDeleted()
public final boolean isDirty()
public final boolean isNew()
public final boolean isClean()
public final boolean isDetached()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |