|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.tentackle.db.DbObject
org.tentackle.db.DbPreferencesKey
public class DbPreferencesKey
A preferences key/value pair stored in the database.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.tentackle.db.DbObject |
|---|
DbObject.CopyAllToDbLogger, DbObject.IdComparator<T extends DbObject>, DbObject.NameComparator<T extends DbObject>, DbObject.NameIdComparator<T extends DbObject> |
| Field Summary | |
|---|---|
static String |
FIELD_KEY
database column name for key |
static String |
FIELD_NODEID
database column name for nodeId |
static String |
FIELD_VALUE
database column name for value |
static String |
TABLENAME
database tablename |
| Fields inherited from class org.tentackle.db.DbObject |
|---|
BEGIN, COMMIT, DELETE, DELETEALL, FIELD_ID, FIELD_SERIAL, FIELD_TABLESERIAL, idComparator, INSERT, lazyMethodInterval, nameComparator, nameIdComparator, TX_DELETE_LIST, TX_DELETE_MISSING_IN_LIST, TX_DELETE_OBJECT, TX_DUMMY_UPDATE, TX_INSERT_OBJECT, TX_INSERT_PLAIN, TX_SAVE, TX_SAVE_LIST, TX_UPDATE_OBJECT, TX_UPDATE_PLAIN, TX_UPDATE_SERIAL, TX_UPDATE_SERIAL_AND_TABLESERIAL, TX_UPDATE_TABLESERIAL, UPDATE |
| Constructor Summary | |
|---|---|
DbPreferencesKey()
Creates a preferences key (without db connection). |
|
DbPreferencesKey(Db db)
Creates a preferences key. |
|
| Method Summary | |
|---|---|
int |
deleteByNodeId(long nodeId)
Deletes all keys for a node. |
DbObjectClassVariables |
getDbObjectClassVariables()
Gets the some attributes and variables common to all objects of the same class. |
boolean |
getFields(ResultSetWrapper rs)
Retrieves the values of all fields (all columns of the database table) in the given ResultSetWrapper and stores them in the object's attributes. |
ImageIcon |
getIcon()
Gets the icon of this object. |
String |
getKey()
Gets the db attribute key |
DbPreferencesNode |
getLazyNode()
|
long |
getNodeId()
Gets the db attribute nodeId |
String |
getValue()
Gets the db attribute value |
boolean |
isCountingModification(int modType)
Determines whether modifications of this object are counted in the modification table. |
boolean |
isTableSerialValid()
By default objects don't need to include the tableSerial in the database table. |
boolean |
isTracked()
Overridden cause of "--tracked". |
int |
prepareInsertStatement()
Prepares the insert statement. |
boolean |
prepareSetFields()
Prepares the object's attributes before the object is saved to the database. |
int |
prepareUpdateStatement()
Prepare the update statement. |
DbPreferencesKey |
select(long id)
Selects a preferences key by its ID. |
List<DbPreferencesKey> |
selectByNodeId(long nodeId)
Gets all keys belonging to a node. |
DbPreferencesKey |
selectByNodeIdKey(long nodeId,
String key)
Get a preferences key by nodeid and key name. |
int |
setFields(PreparedStatementWrapper st)
Sets the values of all fields (all columns of the database table) in the given PreparedStatementWrapper from the object's attributes. |
void |
setKey(String key)
Sets the db attribute key |
void |
setLazyNode(DbPreferencesNode node)
sets the "lazy" parent, i.e. |
void |
setNodeId(long nodeId)
Sets the db attribute nodeId |
void |
setValue(String value)
Sets the db attribute value |
String |
toString()
Gets the default string value. The default implementation invokes DbObject.toGenericString(). |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String TABLENAME
public static final String FIELD_NODEID
public static final String FIELD_KEY
public static final String FIELD_VALUE
| Constructor Detail |
|---|
public DbPreferencesKey(Db db)
db - the db connectionpublic DbPreferencesKey()
| Method Detail |
|---|
public String toString()
DbObjectDbObject.toGenericString().
toString in class DbObjectpublic ImageIcon getIcon()
DbObjectPlafGlobal.getIcon(java.lang.String, java.lang.String)("unknown").
getIcon in class DbObjectpublic boolean isCountingModification(int modType)
DbObject
isCountingModification in class DbObjectmodType - is one of the modtypes INSERT, UPDATE, DELETE, ...
ModificationCounterpublic boolean isTableSerialValid()
DbObject
isTableSerialValid in class DbObjectpublic void setLazyNode(DbPreferencesNode node)
node - the parent node, null if none.public DbPreferencesNode getLazyNode()
public boolean prepareSetFields()
Overridden to set the parent id if lazy parent set and has no id
prepareSetFields in class DbObjectpublic boolean getFields(ResultSetWrapper rs)
DbObjectResultSetWrapper and stores them in the object's attributes.
getFields in class DbObjectrs - the result set
public int setFields(PreparedStatementWrapper st)
DbObjectPreparedStatementWrapper from the object's attributes.
setFields in class DbObjectst - the statement
public DbPreferencesKey select(long id)
select in class DbObjectid - is the object id
public DbObjectClassVariables getDbObjectClassVariables()
DbObjectDbObjectClassVariables.
getDbObjectClassVariables in class DbObjectpublic int prepareInsertStatement()
DbObject
prepareInsertStatement in class DbObjectpublic int prepareUpdateStatement()
DbObject
prepareUpdateStatement in class DbObjectpublic List<DbPreferencesKey> selectByNodeId(long nodeId)
nodeId - the node's ID
public DbPreferencesKey selectByNodeIdKey(long nodeId,
String key)
nodeId - the node IDkey - the key name
public int deleteByNodeId(long nodeId)
nodeId - the node's ID
public boolean isTracked()
isTracked in class DbObjectpublic long getNodeId()
public void setNodeId(long nodeId)
nodeId - ID of the preferences nodepublic String getKey()
public void setKey(String key)
key - name of the keypublic String getValue()
public void setValue(String value)
value - value of the key
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||