java.lang.Object
ru.bitel.common.dao.AbstarctDaoConstant
ru.bitel.common.dao.AbstractDao<B>
ru.bitel.common.dao.AbstractIdDao<DocumentPattern>
ru.bitel.bgbilling.plugins.documents.server.bean.pattern.DocumentsPatternDao
All Implemented Interfaces:
AutoCloseable

public class DocumentsPatternDao extends ru.bitel.common.dao.AbstractIdDao<DocumentPattern>
  • Nested Class Summary

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

    ru.bitel.common.dao.AbstractDao.ResultSetIterator
  • Field Summary

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

    cacheFilter, cacheJoin, cacheOrderBy, cachePaged, cachePS, cacheWhat, getByIdPS, moduleId, orderByPattern, tableName

    Fields inherited from class ru.bitel.common.dao.AbstarctDaoConstant

    ERROR, fields, SQL_CALC_FOUND_ROWS, SQL_DELETE, SQL_DISTINCT, SQL_EQ, SQL_EQCS, SQL_FROM, SQL_GROUP, SQL_IN, SQL_INSERT, SQL_LIMIT, SQL_ON_DUPLICATE_KEY_UPDATE, SQL_ORDER, SQL_SELECT, SQL_SET, SQL_UPDATE, SQL_VALUES, SQL_WHERE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    deleteDomainList(int patternId)
    Удаление списка привязанных к шаблону доменов
    void
    deleteVariableList(int patternId)
    Удаление списка переменных из указанного шаблона
    getDomainList(int patternId)
    Получение списка переменных для указанного шаблона
    protected DocumentPattern
    Получение объекта DocumentPattern из результатов выборки БД.
    getPattern(int patternId)
    Получение единственного шаблона документа из БД по его коду
    Возвращает список шаблонов документов.
    getTableList(int patternId)
    Получение списка таблиц для указанного шаблона
    getVariableList(int patternId)
    Получение списка переменных для указанного шаблона
    protected void
    Обновление/Добавление шаблона документа.
    void
    updatePos(List<int[]> idPosList)
     

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

    delete, get, getAndDelete, getAndUpdate, opt

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

    close, delete, deleteImpl, eq, get, getById, getImpl, getListFromRS, getLogger, getPeriod, getQueryById, getSQLOrder, getTableName, list, list, listImpl, listImpl, listImplPS, listImplPS, ormFromResultSet, ormUpdateImpl, ormUpdateImpl, ormUpdateImpl, ormUpdateImpl, processException, recycle, setStatementParam, update

    Methods inherited from class ru.bitel.common.dao.AbstarctDaoConstant

    getSQLOrder

    Methods inherited from class java.lang.Object

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

    • DocumentsPatternDao

      public DocumentsPatternDao(Connection con)
  • Method Details

    • getPatternList

      public List<DocumentPattern> getPatternList() throws ru.bitel.bgbilling.common.BGException
      Возвращает список шаблонов документов. Каждый шаблон содержит список переменных и таблиц
      Returns:
      список шаблонов документов.
      Throws:
      ru.bitel.bgbilling.common.BGException
    • getPattern

      public DocumentPattern getPattern(int patternId) throws ru.bitel.bgbilling.common.BGException
      Получение единственного шаблона документа из БД по его коду
      Parameters:
      patternId - код шаблона
      Returns:
      шаблон документа
      Throws:
      ru.bitel.bgbilling.common.BGException
    • getVariableList

      public List<DocumentVariable> getVariableList(int patternId) throws ru.bitel.bgbilling.common.BGException
      Получение списка переменных для указанного шаблона
      Parameters:
      patternId - код шаблона документа
      Returns:
      список переменных
      Throws:
      ru.bitel.bgbilling.common.BGException
    • deleteVariableList

      public void deleteVariableList(int patternId) throws ru.bitel.bgbilling.common.BGException
      Удаление списка переменных из указанного шаблона
      Parameters:
      patternId - код шаблона документа
      Throws:
      ru.bitel.bgbilling.common.BGException
    • getDomainList

      public List<Integer> getDomainList(int patternId) throws ru.bitel.bgbilling.common.BGException
      Получение списка переменных для указанного шаблона
      Parameters:
      patternId - код шаблона документа
      Returns:
      список переменных
      Throws:
      ru.bitel.bgbilling.common.BGException
    • deleteDomainList

      public void deleteDomainList(int patternId) throws ru.bitel.bgbilling.common.BGException
      Удаление списка привязанных к шаблону доменов
      Parameters:
      patternId - код шаблона, для которого нужно очистить связи с доменами
      Throws:
      ru.bitel.bgbilling.common.BGException
    • getTableList

      public List<DocumentTable> getTableList(int patternId) throws ru.bitel.bgbilling.common.BGException
      Получение списка таблиц для указанного шаблона
      Parameters:
      patternId - код шаблона документа
      Returns:
      список таблиц
      Throws:
      ru.bitel.bgbilling.common.BGException
    • getFromRS

      protected DocumentPattern getFromRS(ResultSet rs) throws SQLException, ru.bitel.bgbilling.common.BGException
      Получение объекта DocumentPattern из результатов выборки БД.
      Specified by:
      getFromRS in class ru.bitel.common.dao.AbstractDao<DocumentPattern>
      Parameters:
      rs - результат выборки БД
      Returns:
      объект DocumentPattern
      Throws:
      SQLException
      ru.bitel.bgbilling.common.BGException
    • updateImpl

      protected void updateImpl(DocumentPattern b) throws ru.bitel.bgbilling.common.BGException, SQLException
      Обновление/Добавление шаблона документа. Перед обновлением переменных и таблиц сперва из БД удаляются все имеющиеся переменные и таблицы. Это сделано для того, чтобы каждый раз не высчитывать какие переменные и таблицы были удалены/обновлены/добавлены в данный шаблон.
      Specified by:
      updateImpl in class ru.bitel.common.dao.AbstractDao<DocumentPattern>
      Parameters:
      b - обновляемый/добавляемый шаблон документа
      Throws:
      ru.bitel.bgbilling.common.BGException
      SQLException
    • updatePos

      public void updatePos(List<int[]> idPosList) throws ru.bitel.bgbilling.common.BGException
      Throws:
      ru.bitel.bgbilling.common.BGException