Interface IDsDbManager<RECORDCLASS extends IDsRecord>

All Superinterfaces:
de.uplanet.lucy.server.usermanager.ds.IDsAttributesHelper

public interface IDsDbManager<RECORDCLASS extends IDsRecord> extends de.uplanet.lucy.server.usermanager.ds.IDsAttributesHelper
  • Method Details

    • getLastSqlStmt

      String getLastSqlStmt()
    • getConnection

      de.uplanet.jdbc.JdbcConnection getConnection()
      Returns:
      the jdbc conntection
    • getClassName

      String getClassName()
      Returns:
      the class name (the STRNAME column in DSCLASS)
    • getClassDef

      DsClass getClassDef()
      Returns:
      the class definition, see DsClass
    • selectFullRecord

      List<RECORDCLASS> selectFullRecord(de.uplanet.lucy.server.usermanager.ds.IDsFilter p_whereFilter, IDsOrder[] p_orderFields) throws SQLException
      Returns a full list of records (all fields (Attributes) in the record will be set, like select * from)
      Parameters:
      p_whereFilter - can be null, used to set an filter for the select statement
      p_orderFields - can be null, used to set an order to the select statement
      Returns:
      a list of records, or null when no record found
      Throws:
      SQLException
    • selectFullRecord

      List<RECORDCLASS> selectFullRecord(de.uplanet.lucy.server.usermanager.ds.IDsFilter p_whereFilter, IDsOrder[] p_orderFields, int p_iFirstRow, int p_iRows) throws SQLException
      Returns a full list of records. In the record all fields will be set.
      Parameters:
      p_whereFilter - can be null, used to set an filter for the select statement
      p_orderFields - can be null, used to set an order to the select statement
      p_iFirstRow - used for pageing, the starting row
      p_iRows - the maximal count of records or -1 for all
      Returns:
      a list of records, or empty list when no record found
      Throws:
      SQLException
    • selectCount

      int selectCount(de.uplanet.lucy.server.usermanager.ds.IDsFilter p_whereFilter) throws SQLException
      Returns the count of records found in the class
      Parameters:
      p_whereFilter -
      Returns:
      count of records found in class
      Throws:
      SQLException
    • selectFullByPrimaryKey

      RECORDCLASS selectFullByPrimaryKey(int p_iPrimaryKeyValue) throws SQLException
      Returns one record, that is full read. or null when no record found by the given primary key.
      Parameters:
      p_iPrimaryKeyValue -
      Returns:
      record with all fields, or null when no record found
      Throws:
      SQLException
    • selectFullByGuid

      RECORDCLASS selectFullByGuid(String p_strGuid) throws SQLException
      Returns one record, that is full read. or null when no record found by the given guid.
      Parameters:
      p_strGuid -
      Returns:
      record with all fields or null when not found
      Throws:
      SQLException
    • selectByGuid

      RECORDCLASS selectByGuid(String p_strGuid, String... p_selectFieldGuids) throws SQLException
      Returns one record coresponding to the given guid. (At least the primary key field is set in the record object)
      Parameters:
      p_strGuid - the guid
      p_selectFieldGuids - The fields, which will read from the db and will be set in the record object
      Returns:
      null if no record found, or an record object filled with the fields (+ primary key) given by the l_selctFieldGuids
      Throws:
      SQLException
    • selectByPrimaryKey

      RECORDCLASS selectByPrimaryKey(int p_iPrimaryKeyValue, String... p_selectFieldGuids) throws SQLException
      Returns one record coresponding to the given primary key. (At least the primary key field is set in the record object)
      Parameters:
      p_iPrimaryKeyValue - the primary key
      p_selectFieldGuids - The fields, which will read from the db and will be set in the record object
      Returns:
      null if no record found, or an record object filled with the fields (+ primary key) given by the l_selectFieldGuids or throws a DsRuntimeException if a record with a bad type is readed
      Throws:
      SQLException
    • selectByPrimaryKey

      RECORDCLASS selectByPrimaryKey(int p_iPrimaryKeyValue, Collection<String> p_selectFieldGuids) throws SQLException
      Returns one record coresponding to the given primary key. (At least the primary key field is set in the record object)
      Parameters:
      p_iPrimaryKeyValue - the primary key
      p_selectFieldGuids - The fields, which will read from the db and will be set in the record object
      Returns:
      null if no record found, or an record object filled with the fields (+ primary key) given by the l_selectFieldGuids or throws a DsRuntimeException if a record with a bad type is readed
      Throws:
      SQLException
    • select

      List<RECORDCLASS> select(de.uplanet.lucy.server.usermanager.ds.IDsFilter p_where, IDsOrder[] p_orderFields, String... p_selectfieldGuids) throws SQLException
      Select an list of records. At least the primary key fields is set in the record object. Other fields only set when given in p_selectFieldGuids paramter.
      Parameters:
      p_where - used for the where clause IDsFilter (can be null)
      p_orderFields - used for the order by clause. (can be null)
      p_selectfieldGuids - field guids depends on the STRGUID field in DSATTR (at least one element)
      Returns:
      list of records or an empty list if no records was found. or throws a DsRuntimeException if a record with a bad type is readed
      Throws:
      SQLException
    • selectIterate

      RECORDCLASS selectIterate(de.uplanet.lucy.server.usermanager.ds.IDsFilter p_where, IDsOrder[] p_orderFields, IDsSelectIterator p_iterator, String... p_selectfieldGuids) throws SQLException
      Parameters:
      p_where - the where clause (can be null)
      p_orderFields - the sort fields (can be null)
      p_iterator - the iterator called, to select the records (must not be null)
      p_selectfieldGuids - field guids depends on the STRGUID field in DSATTR (at least one element)
      Returns:
      null or a record or throws a DsRuntimeException if a record with a bad type is readed
      Throws:
      SQLException
    • select

      List<RECORDCLASS> select(de.uplanet.lucy.server.usermanager.ds.IDsFilter p_where, IDsOrder[] p_orderFields, int p_iFirstRow, int p_iRows, String... p_selectfieldGuids) throws SQLException
      Select an list of records. At least the primary key fields is set in the record object. Other fields only set when given in p_selectFieldGuids parameter. (can used for pageing)
      Parameters:
      p_where - used for the where clause IDsFilter (can be null)
      p_orderFields - used for the order by clause. (can be null)
      p_iFirstRow - start row index or <= 0 for first row start
      p_iRows - maximal count of rows return , or -1 for all rows shoudl returned
      p_selectfieldGuids - field guids depends on the STRGUID field in DSATTR (at least one element)
      Returns:
      empty list, if no record was found otherwise a list of readed records or throws a DsRuntimeException if a record with a bad type is readed
      Throws:
      SQLException
    • select

      List<RECORDCLASS> select(de.uplanet.lucy.server.usermanager.ds.IDsFilter p_where, IDsOrder[] p_orderFields, int p_iFirstRow, int p_iRows, IDsSelectIterator p_iterator, String... p_selectfieldGuids) throws SQLException
      Parameters:
      p_where - can be null
      p_orderFields - can be null
      p_iFirstRow - <= 0 starts at begin (used for pageing)
      p_iRows - -1 for all, otherwise the maximal read count
      p_iterator - can be null, can be used to check if an record should added to the return List or to end the reading
      p_selectfieldGuids -
      Returns:
      empty list if no records was found otherwise a list of records or throws a DsRuntimeException if a record with a bad type is readed
      Throws:
      SQLException
    • select

      List<RECORDCLASS> select(de.uplanet.lucy.server.usermanager.ds.IDsFilter p_where, IDsOrder[] p_orderFields, int p_iFirstRow, int p_iRows, IDsSelectIterator p_iterator, boolean p_bDistinct, String... p_selectfieldGuids) throws SQLException
      Parameters:
      p_where - can be null
      p_orderFields - can be null
      p_iFirstRow - <= 0 starts at begin (used for pageing)
      p_iRows - -1 for all, otherwise the maximal read count
      p_iterator - can be null, can be used to check if an record should added to the return List or to end the reading
      p_bDistinct - Distinct select?
      p_selectfieldGuids -
      Returns:
      empty list if no records was found otherwise a list of records or throws a DsRuntimeException if a record with a bad type is readed
      Throws:
      SQLException
    • select

      List<RECORDCLASS> select(de.uplanet.lucy.server.businesslogic.user.jdbc.IDsFilterSelect p_selectFilter) throws SQLException
      Throws:
      SQLException
    • update

      int update(int p_pkValue, IDsRecord p_updateRecord) throws SQLException
      Udates a user manager object. (the PK field value is readonly)
      Parameters:
      p_pkValue - The primary key
      p_updateRecord - The update record
      Returns:
      update count
      Throws:
      SQLException
    • insert

      int insert(IDsRecord p_insertRecord) throws SQLException
      Inserts an new record object. If an record with the same name, classid, containerid and bdeleted = true exists this record will be updated with the given p_insertRecord otherwise the p_insertRecord is inserted if no primary key value is set in the p_insertRecord, a new primary key value will be generated
      Parameters:
      p_insertRecord - not nullable (on null an IllegalArgumentException will be thrown)
      Returns:
      the generated pk Key value or 0 if the insert fails
      Throws:
      SQLException
    • delete

      void delete(int p_iPrimaryKeyValue) throws SQLException
      Marks the class object given by the p_iPrimaryKey value as deleted if that record is marked as not deletable an Runtime exception will be thrown
      Parameters:
      p_iPrimaryKeyValue -
      Throws:
      SQLException
      RuntimeException
    • getDbColumnByGuid

      de.uplanet.lucy.server.usermanager.ds.DbColumn getDbColumnByGuid(String p_strGUID)
      Returns an DbColumn Object for the class attribute given by the GUID.
      Specified by:
      getDbColumnByGuid in interface de.uplanet.lucy.server.usermanager.ds.IDsAttributesHelper
      Parameters:
      p_strGUID - may not be null
      Returns:
      DbColumn
    • getDbColumnByGuid

      de.uplanet.lucy.server.usermanager.ds.DbColumn getDbColumnByGuid(String p_strGUID, Map<String,DsClass> p_tblAliasToClassMap)
      Returns an DbColumn Object for the class attribute given by the parameter p_strGuid
      Specified by:
      getDbColumnByGuid in interface de.uplanet.lucy.server.usermanager.ds.IDsAttributesHelper
      Parameters:
      p_strGUID - The Column guid (must not be null)
      p_tblAliasToClassMap - saves the table mapping (the table alias to the correspondig class definition)
      Returns:
      DbColumn
    • setCustomAttributeHelper

      void setCustomAttributeHelper(de.uplanet.lucy.server.usermanager.ds.IDsAttributesHelper p_helper)
      Parameters:
      p_helper - Helper for custom fields.
    • getCustomAttributeHelper

      de.uplanet.lucy.server.usermanager.ds.IDsAttributesHelper getCustomAttributeHelper()
      Returns:
      The custom attribute helper
    • getAttributeHelper

      de.uplanet.lucy.server.usermanager.ds.IDsAttributesHelper getAttributeHelper()
      Returns:
      The attribute helper