Class DbPreferencesNode

java.lang.Object
org.tentackle.dbms.AbstractDbObject<DbPreferencesNode>
org.tentackle.dbms.prefs.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 Details

  • Constructor Details

    • DbPreferencesNode

      public DbPreferencesNode(Db db)
      Creates a node.
      Parameters:
      db - the session
    • 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

      public DbObjectClassVariables<DbPreferencesNode> getClassVariables()
      Description copied from class: AbstractDbObject
      Gets some attributes and variables common to all objects of the same class. Class variables for classes derived from AbstractDbObject are kept in an instance of DbObjectClassVariables.
      Overrides:
      getClassVariables in class AbstractDbObject<DbPreferencesNode>
      Returns:
      the class variables
    • selectByRootNodeId

      public org.tentackle.misc.TrackedArrayList<DbPreferencesNode> selectByRootNodeId(long rootNodeId)
      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

      public org.tentackle.misc.TrackedArrayList<DbPreferencesNode> selectByParentId(long parentId)
      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

      public DbPreferencesNode selectByUserAndName(String user, String name)
      Selects a node by user and name.
      Parameters:
      user - is the username, null = system
      name - 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: AbstractDbObject
      By default, objects don't need to include the tableSerial in the database table.
      Override this method if the object contains a TABLESERIAL-column.
      Overrides:
      isTableSerialProvided in class AbstractDbObject<DbPreferencesNode>
      Returns:
      true if the object is using the tableSerial column, false if not
    • isTracked

      public boolean isTracked()
      Description copied from class: AbstractDbObject
      Checks if the modifications of this object are tracked.
      By default, AbstractDbObjects are not> tracked! This is a quality measure to ensure that AbstractDbObject.isModified() returns false if and only if it hasn't been modified, i.e., the setters check for modification. See the wurblet DbMethods.
      Overrides:
      isTracked in class AbstractDbObject<DbPreferencesNode>
      Returns:
      true if tracked, false otherwise (default)
    • getFields

      public void getFields(ResultSetWrapper rs)
      Description copied from class: AbstractDbObject
      Retrieves the values of all fields.
      Overrides:
      getFields in class AbstractDbObject<DbPreferencesNode>
      Parameters:
      rs - the result set
    • setFields

      public int setFields(PreparedStatementWrapper st)
      Description copied from class: AbstractDbObject
      Sets the values of all fields (all columns of the database table) in the given PreparedStatementWrapper from the object's attributes.
      Overrides:
      setFields in class AbstractDbObject<DbPreferencesNode>
      Parameters:
      st - the statement
      Returns:
      the number of fields set
    • createInsertSql

      public String createInsertSql(Backend backend)
      Description copied from class: AbstractDbObject
      Creates the SQL code for the insert statement.
      Overrides:
      createInsertSql in class AbstractDbObject<DbPreferencesNode>
      Parameters:
      backend - the backend
      Returns:
      the SQL code
    • createUpdateSql

      public String createUpdateSql(Backend backend)
      Description copied from class: AbstractDbObject
      Creates the SQL code for the update statement.
      Overrides:
      createUpdateSql in class AbstractDbObject<DbPreferencesNode>
      Parameters:
      backend - the backend
      Returns:
      the SQL code
    • getUser

      @Persistent(ordinal=1, comment="the name of user, null if system") public String getUser()
      Gets the attribute user.
      Returns:
      the name of user, null if system
    • setUser

      public void setUser(String user)
      Sets the attribute user.
      Parameters:
      user - the name of user, null if system
    • getName

      @Persistent(ordinal=2, comment="the name of the node") public String getName()
      Gets the attribute name.
      Returns:
      the name of the node
    • setName

      public void setName(String name)
      Sets the attribute name.
      Parameters:
      name - the name of the node
    • getParentId

      @Persistent(ordinal=3, comment="the ID of parent-node, 0 if root-node") public long 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

      @Persistent(ordinal=4, comment="the ID of the root-node") public long 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

      public String getBaseName()
      Gets the basename of the node.
      Returns:
      the node's basename
    • toString

      public String toString()
      Description copied from class: AbstractDbObject
      Gets the default string value.
      The default implementation invokes AbstractDbObject.toGenericString().
      Overrides:
      toString in class AbstractDbObject<DbPreferencesNode>
      Returns:
      the string value of this AbstractDbObject