Class ContractScriptDao

java.lang.Object
ru.bitel.bgbilling.kernel.base.server.logger.BGLogger
ru.bitel.bgbilling.common.dao.AbstractDaoConstant
ru.bitel.bgbilling.common.dao.AbstractDao<ContractScript>
ru.bitel.bgbilling.common.dao.AbstractIdDao<ContractScript>
ru.bitel.bgbilling.kernel.contract.api.server.dao.ContractScriptDao

public class ContractScriptDao extends ru.bitel.bgbilling.common.dao.AbstractIdDao<ContractScript>
Класс-менеджер для работы с таблицей contract_script и сущностью ContractScript. ( Привязка скриптов поведения к договору ).
  • Nested Class Summary

    Nested classes/interfaces inherited from class ru.bitel.bgbilling.common.dao.AbstractDao

    ru.bitel.bgbilling.common.dao.AbstractDao.ListParams
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     

    Fields inherited from class ru.bitel.bgbilling.common.dao.AbstractDao

    orderByPattern

    Fields inherited from class ru.bitel.bgbilling.common.dao.AbstractDaoConstant

    con, ERROR, fields, moduleId, SQL_ALL, SQL_AND, SQL_DELETE, SQL_DISTINCT, SQL_EQ, SQL_EQCS, SQL_FROM, SQL_GROUP, SQL_IN, SQL_INSERT, SQL_JOIN, SQL_LEFT_JOIN, SQL_LIMIT, SQL_NOT_IN, SQL_ON, SQL_ORDER, SQL_SELECT, SQL_SET, SQL_UPDATE, SQL_VALUES, SQL_WHERE, tableName
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Удаляет скрипт договора.
    void
    deleteForContract(int contractId)
     
    void
    deleteScript(int scriptId)
    Удаляет скрипт с конкретным кодом скрипта со ВСЕХ договоров.
    void
    deleteScript(int scriptId, List<Integer> cids)
    Удаляет скрипт с конкретным кодом скрипта с указанных договоров.
    Получить скрипт по его коду
    getContractScriptByScriptId(int contractId, int scriptId)
    Возвращает ContractScript для опредлелённого ид-контракта и ид-скрипта, в принципе, был создан пока только для определения существует ли у договора уже этот самый скрипт.
    getContractScriptList(int contractId)
    Возвращает список всех скриптов договора
    getContractScriptList(int contractId, Date date)
    Возвращает список скриптов договора, действующих в определенную дату
    protected ContractScript
     
    void
    serializeContract(Element tables, int contractId)
     
    void
    updateDateTo(int contractId, Date date)
     
    protected void
    updateImpl(ContractScript contractScript)
    Обновляет скрипт договора

    Methods inherited from class ru.bitel.bgbilling.common.dao.AbstractIdDao

    delete, executeUpdate, get, getAndDelete, getAndUpdate, loadData, opt, prepareStatement, sqlCommand, sqlCommandAndTable, sqlInsertValues, sqlQuery, sqlUpdateSet, sqlWhereId

    Methods inherited from class ru.bitel.bgbilling.common.dao.AbstractDao

    deleteImpl, dropTemporaryTable, eq, get, getById, getImpl, getListFromRS, getPeriod, getQueryById, getQueryWithFilter, getSQLOrder, list, list, list, listCountImplPS, listImpl, listImplPS, ormFromResultSet, ormUpdateImpl, ormUpdateImpl, ormUpdateImpl, ormUpdateImpl, queryPeriod, setPageRecordCount, update

    Methods inherited from class ru.bitel.bgbilling.common.dao.AbstractDaoConstant

    getPlaceholders, getSQLOrder, getSQLOrderFields, getTableName, psSetDate, psSetDateOrNull, psSetInt, psSetIntOrNull, psSetPeriod, psSetString, psSetStringOrNull, psSetTimestampOrNull, queryAndIn, setStatementParam, sqlDelete, sqlDeleteBatch, sqlInsert, sqlInsertBatch, sqlInsertGetId, sqlInsertGetLongId, sqlInsertOnDuplicateKeyUpdate, sqlInsertSelect, sqlInsertUpdateById, sqlSelectCountAsInt, sqlUpdate, sqlUpdateBatch

    Methods inherited from class ru.bitel.bgbilling.kernel.base.server.logger.BGLogger

    error, error, error, getLogger, logError, logError, warn

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • ContractScriptDao

      public ContractScriptDao(Connection con)
  • Method Details

    • getContractScriptList

      public List<ContractScript> getContractScriptList(int contractId) throws SQLException
      Возвращает список всех скриптов договора
      Parameters:
      contractId - код договора
      Returns:
      Throws:
      SQLException
    • getContractScriptList

      public List<ContractScript> getContractScriptList(int contractId, Date date) throws SQLException
      Возвращает список скриптов договора, действующих в определенную дату
      Parameters:
      contractId - код договора
      date - дата
      Returns:
      Throws:
      SQLException
    • getContractScriptById

      public ContractScript getContractScriptById(int id) throws SQLException
      Получить скрипт по его коду
      Parameters:
      id - код скрипта
      Returns:
      null - если нету
      Throws:
      SQLException
    • getContractScriptByScriptId

      public ContractScript getContractScriptByScriptId(int contractId, int scriptId) throws SQLException
      Возвращает ContractScript для опредлелённого ид-контракта и ид-скрипта, в принципе, был создан пока только для определения существует ли у договора уже этот самый скрипт.
      Parameters:
      contractId - договор
      scriptId - скрипт
      Returns:
      объект, если есть
      Throws:
      SQLException
    • deleteContractScript

      public void deleteContractScript(int id) throws SQLException
      Удаляет скрипт договора.
      Parameters:
      id - ид контрактскрипта.
      Throws:
      SQLException
    • deleteScript

      public void deleteScript(int scriptId) throws SQLException
      Удаляет скрипт с конкретным кодом скрипта со ВСЕХ договоров.
      Parameters:
      scriptId - ид скрипта.
      Throws:
      SQLException
    • deleteScript

      public void deleteScript(int scriptId, List<Integer> cids) throws SQLException
      Удаляет скрипт с конкретным кодом скрипта с указанных договоров.
      Parameters:
      scriptId - ид скрипта.
      cids - список ид договоров.
      Throws:
      SQLException
    • getFromRS

      protected ContractScript getFromRS(ResultSet rs) throws SQLException
      Specified by:
      getFromRS in class ru.bitel.bgbilling.common.dao.AbstractDao<ContractScript>
      Throws:
      SQLException
    • updateImpl

      protected void updateImpl(ContractScript contractScript) throws SQLException
      Обновляет скрипт договора
      Specified by:
      updateImpl in class ru.bitel.bgbilling.common.dao.AbstractDao<ContractScript>
      Parameters:
      contractScript - скрипт
      Throws:
      SQLException
    • deleteForContract

      public void deleteForContract(int contractId) throws SQLException
      Throws:
      SQLException
    • updateDateTo

      public void updateDateTo(int contractId, Date date) throws SQLException
      Throws:
      SQLException
    • serializeContract

      public void serializeContract(Element tables, int contractId) throws SQLException, XMLStreamException
      Throws:
      SQLException
      XMLStreamException