Class DbPreferencesNode
- All Implemented Interfaces:
Serializable, Comparable<DbPreferencesNode>, ModificationLoggable, org.tentackle.misc.Identifiable, org.tentackle.misc.Immutable, org.tentackle.misc.SerialNumbered, SessionDependable, SessionProvider
@ClassId(3)
@TableName("prefnode")
public class DbPreferencesNode
extends AbstractDbObject<DbPreferencesNode>
Preferences Node stored in the database.
- Author:
- harald
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final DbObjectClassVariables<DbPreferencesNode> Variables common to all instances ofDbPreferencesNode.static final Stringdatabase column name for 'name'.static final Stringdatabase column name for 'parentId'.static final Stringdatabase column name for 'rootNodeId'.static final Stringdatabase column name for 'user'.Fields inherited from class AbstractDbObject
AN_CLASSID, AN_ID, AN_SERIAL, AN_TABLESERIAL, CN_CLASSID, CN_ID, CN_SERIAL, CN_TABLESERIAL, 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_SYNC, TX_UPDATE_OBJECT, TX_UPDATE_PLAIN, TX_UPDATE_SERIAL, TX_UPDATE_SERIAL_AND_TABLESERIAL, TX_UPDATE_TABLESERIAL -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateInsertSql(Backend backend) Creates the SQL code for the insert statement.createUpdateSql(Backend backend) Creates the SQL code for the update statement.Gets the basename of the node.Gets some attributes and variables common to all objects of the same class.voidRetrieves the values of all fields.getName()Gets the attribute name.longGets the attribute parentId.longGets the attribute rootNodeId.getUser()Gets the attribute user.booleanReturns whether node has been marked as removed.booleanBy default, objects don't need to include the tableSerial in the database table.
Override this method if the object contains a TABLESERIAL-column.booleanChecks if the modifications of this object are tracked.
By default,AbstractDbObjectsare not> tracked!org.tentackle.misc.TrackedArrayList<DbPreferencesNode> selectByParentId(long parentId) Gets all nodes belonging to a parent node.org.tentackle.misc.TrackedArrayList<DbPreferencesNode> selectByRootNodeId(long rootNodeId) Gets all keys belonging to a root node and all its sub nodes sorted by id.selectByUserAndName(String user, String name) Selects a node by user and name.intSets the values of all fields (all columns of the database table) in the givenPreparedStatementWrapperfrom the object's attributes.voidSets the attribute name.voidsetParentId(long parentId) Sets the attribute parentId.voidsetRemoved(boolean removed) Sets the removed flag.voidsetRootNodeId(long rootNodeId) Sets the attribute rootNodeId.voidSets the attribute user.toString()Gets the default string value.
The default implementation invokesAbstractDbObject.toGenericString().Methods inherited from class AbstractDbObject
acceptPersistenceVisitor, addPropertyListener, addPropertyListener, alignComponents, applyDbObjectResult, assertMutable, assertNew, assertNotNew, assertNotOverloaded, assertNotRemote, assertNumberOfRowsAffected, assertPersistable, assertRemote, assertThisRowAffected, attributesModified, clearFromThisJVM, clearOnRemoteSave, compareTo, countModification, createDeleteAllSql, createDeleteSql, createDummyUpdateSql, createPreparedStatement, createPreparedStatement, createPropertySupport, createSelectAllByIdInnerSql, createSelectAllIdSerialInnerSql, createSelectAllInnerSql, createSelectExpiredTableSerials1Sql, createSelectExpiredTableSerials2Sql, createSelectIdInnerSql, createSelectMaxIdSql, createSelectMaxTableSerialSql, createSelectObjectsWithExpiredTableSerialsSql, createSelectSerialSql, createSelectSql, createSqlUpdate, createStatementKey, createUpdateAndSetSerialSql, createUpdateSerialAndTableSerialSql, createUpdateSerialSql, deleteImpl, deleteObject, deletePlain, deleteReferencedRelations, deleteReferencingRelations, differsPersisted, dummyUpdate, equals, finishModification, finishNotUpdated, firePropertyChange, getBackend, getClassBaseName, getClassId, getColumnCount, getExpiredTableSerials, getId, getIdSource, getImmutableLoggingLevel, getModificationCount, getPreparedStatement, getPreparedStatement, getPropertySupport, getRemoteDelegate, getSerial, getSession, getSessionHolder, getTableName, getTableSerial, hashCode, initModification, insertImpl, insertObject, insertPlain, isCopy, isCountingModification, isDeleted, isEntity, isFinallyImmutable, isForcedModified, isFromThisJVM, isIdValid, isImmutable, isLoggingModification, isModified, isNew, isOverloadable, isPersistable, isReferenced, isRemovable, isReplayedLeniently, isSessionImmutable, isStatementAlwaysPrepared, isUpdateNecessary, isUpdatingSerialEvenIfNotModified, isVirgin, loadLazyReferences, logModification, markDeleted, newId, newInstance, newInstance, newInstance, persistObject, prepareDelete, prepareSave, prepareSetFields, readFromResultSetWrapper, reloadObject, reloadObjectForUpdate, removeAllPropertyListeners, removePropertyListener, removePropertyListener, reserveId, reserveId, resultAllIdSerial, resultAllObjects, resultObjectsWithExpiredTableSerials, revertAttributesToSnapshot, saveObject, saveReferencedRelations, saveReferencingRelations, selectAllIdSerial, selectAllObjects, selectExpiredTableSerials, selectExpiredTableSerials, selectMaxId, selectMaxTableSerial, selectNextObject, selectObject, selectObjectForUpdate, selectObjectsWithExpiredTableSerials, selectSerial, setClassId, setFinallyImmutable, setId, setImmutable, setImmutableLoggingLevel, setModified, setOverloadable, setSerial, setSession, setSessionHolder, setSessionImmutable, setStatementAlwaysPrepared, setTableSerial, toGenericString, toIdString, unmarkDeleted, updateImpl, updateObject, updatePlain, updateSerial, updateSerial, updateSerialAndTableSerialMethods inherited from interface ModificationLoggable
createModificationLog
-
Field Details
-
CLASSVARIABLES
Variables common to all instances ofDbPreferencesNode. -
CN_USER
-
CN_NAME
-
CN_PARENTID
-
CN_ROOTNODEID
-
-
Constructor Details
-
DbPreferencesNode
-
DbPreferencesNode
public DbPreferencesNode()Creates a node (without db).
-
-
Method Details
-
isRemoved
public boolean isRemoved()Returns whether node has been marked as removed.- Returns:
- true if removed
-
setRemoved
public void setRemoved(boolean removed) Sets the removed flag.- Parameters:
removed- true if removed
-
getClassVariables
Description copied from class:AbstractDbObjectGets some attributes and variables common to all objects of the same class. Class variables for classes derived from AbstractDbObject are kept in an instance ofDbObjectClassVariables.- Overrides:
getClassVariablesin classAbstractDbObject<DbPreferencesNode>- Returns:
- the class variables
-
selectByRootNodeId
Gets all keys belonging to a root node and all its sub nodes sorted by id.- Parameters:
rootNodeId- the root's ID- Returns:
- List of keys
- Wurblet:
- selectByRootNodeId DbSelectList --model=$mapfile rootNodeId | +id
-
selectByParentId
Gets all nodes belonging to a parent node.- Parameters:
parentId- the ID of the parent node, 0 = rootnode- Returns:
- List of nodes
- Wurblet:
- selectByParentId DbSelectList --model=$mapfile parentId
-
selectByUserAndName
Selects a node by user and name.- Parameters:
user- is the username, null = systemname- is the absolute pathname of the node, ""=root- Returns:
- the node
- Wurblet:
- selectByUserAndName DbSelectUnique --model=$mapfile user name
-
isTableSerialProvided
public boolean isTableSerialProvided()Description copied from class:AbstractDbObjectBy default, objects don't need to include the tableSerial in the database table.
Override this method if the object contains a TABLESERIAL-column.- Overrides:
isTableSerialProvidedin classAbstractDbObject<DbPreferencesNode>- Returns:
- true if the object is using the tableSerial column, false if not
-
isTracked
public boolean isTracked()Description copied from class:AbstractDbObjectChecks if the modifications of this object are tracked.
By default,AbstractDbObjectsare not> tracked! This is a quality measure to ensure thatAbstractDbObject.isModified()returns false if and only if it hasn't been modified, i.e., the setters check for modification. See the wurblet DbMethods.- Overrides:
isTrackedin classAbstractDbObject<DbPreferencesNode>- Returns:
- true if tracked, false otherwise (default)
-
getFields
Description copied from class:AbstractDbObjectRetrieves the values of all fields.- Overrides:
getFieldsin classAbstractDbObject<DbPreferencesNode>- Parameters:
rs- the result set
-
setFields
Description copied from class:AbstractDbObjectSets the values of all fields (all columns of the database table) in the givenPreparedStatementWrapperfrom the object's attributes.- Overrides:
setFieldsin classAbstractDbObject<DbPreferencesNode>- Parameters:
st- the statement- Returns:
- the number of fields set
-
createInsertSql
Description copied from class:AbstractDbObjectCreates the SQL code for the insert statement.- Overrides:
createInsertSqlin classAbstractDbObject<DbPreferencesNode>- Parameters:
backend- the backend- Returns:
- the SQL code
-
createUpdateSql
Description copied from class:AbstractDbObjectCreates the SQL code for the update statement.- Overrides:
createUpdateSqlin classAbstractDbObject<DbPreferencesNode>- Parameters:
backend- the backend- Returns:
- the SQL code
-
getUser
Gets the attribute user.- Returns:
- the name of user, null if system
-
setUser
Sets the attribute user.- Parameters:
user- the name of user, null if system
-
getName
Gets the attribute name.- Returns:
- the name of the node
-
setName
-
getParentId
Gets the attribute parentId.- Returns:
- the ID of parent-node, 0 if root-node
-
setParentId
public void setParentId(long parentId) Sets the attribute parentId.- Parameters:
parentId- the ID of parent-node, 0 if root-node
-
getRootNodeId
Gets the attribute rootNodeId.- Returns:
- the ID of the root-node
-
setRootNodeId
public void setRootNodeId(long rootNodeId) Sets the attribute rootNodeId.- Parameters:
rootNodeId- the ID of the root-node
-
getBaseName
-
toString
Description copied from class:AbstractDbObjectGets the default string value.
The default implementation invokesAbstractDbObject.toGenericString().- Overrides:
toStringin classAbstractDbObject<DbPreferencesNode>- Returns:
- the string value of this AbstractDbObject
-