ru.bitel.oss.systems.inventory.product.server.bean

## Class ProductDao

- java.lang.Object
- - ru.bitel.common.dao.AbstarctDaoConstant
  - - ru.bitel.common.dao.AbstractDao<B>
    - - ru.bitel.common.dao.AbstractIdDao<Product>
      - - ru.bitel.oss.systems.inventory.product.server.bean.ProductDao

- All Implemented Interfaces:
    java.lang.AutoCloseable

      public class ProductDao
      extends ru.bitel.common.dao.AbstractIdDao<Product>

- - ### Nested Class Summary

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

      `ru.bitel.common.dao.AbstractDao.ResultSetIterator`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected java.sql.PreparedStatement` | `getByContractAndIdPS`

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

      `cacheFilter, cacheJoin, cacheOrderBy, cachePaged, cachePS, cacheWhat, con, getByIdPS, mid, moduleId, orderByPattern, tableName`

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

      `ERROR, 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 and Description
    `ProductDao(java.sql.Connection con, int userId)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `checkProductSpecActivationModeDelete(int activationModeId)`
    `void` | `checkProductSpecDelete(int productSpecId)`
    `void` | `deactivate(Product product, boolean customer)`
    `int` | `delete(int contractId, int id)`
    `Product` | `get(int contractId, int id)`
    `Product` | `getAndDelete(int contractId, int id)`
    `protected Product` | `getFromRS(java.sql.ResultSet rs)`
    `java.util.List<Product>` | `list(int moduleId, int contractId, int accountId, boolean kernel, java.util.Date time)`
    `java.util.List<Product>` | `list(int moduleId, int contractId, int accountId, boolean kernel, java.util.Date timeFrom, java.util.Date timeTo, java.util.Date timeFromIntersect, java.util.Date timeToIntersect, boolean needNonActive, boolean titleLoad)` Получение списка продуктов договора.
    `void` | `recycle()`
    `void` | `updateDeviceState(int contractId, int tvAccountId, int productId, java.lang.String deviceProductId, short deviceState)` Обновление состояния продукта.
    `protected void` | `updateImpl(Product product)`

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

      `delete, get, getAndDelete, getAndUpdate`

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

      `close, delete, deleteImpl, eq, get, getById, getImpl, getListFromRS, getPeriod, getSQLOrder, getTableName, list, list, listImpl, listImpl, listImplPS, listImplPS, ormFromResultSet, ormUpdateImpl, ormUpdateImpl, processException, 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`

- - ### Field Detail

    - #### getByContractAndIdPS

          protected java.sql.PreparedStatement getByContractAndIdPS

  - ### Constructor Detail

    - #### ProductDao

          public ProductDao(java.sql.Connection con,
                            int userId)

  - ### Method Detail

    - #### getFromRS

          protected Product getFromRS(java.sql.ResultSet rs)
                               throws java.sql.SQLException

      Specified by:
        `getFromRS` in class `ru.bitel.common.dao.AbstractDao<Product>`
      Throws:
        `java.sql.SQLException`

    - #### updateImpl

          protected void updateImpl(Product product)
                             throws ru.bitel.bgbilling.common.BGException,
                                    java.sql.SQLException

      Specified by:
        `updateImpl` in class `ru.bitel.common.dao.AbstractDao<Product>`
      Throws:
        `ru.bitel.bgbilling.common.BGException`
        `java.sql.SQLException`

    - #### deactivate

          public void deactivate(Product product,
                                 boolean customer)
                          throws ru.bitel.bgbilling.common.BGException

      Throws:
        `ru.bitel.bgbilling.common.BGException`

    - #### list

          public java.util.List<Product> list(int moduleId,
                                              int contractId,
                                              int accountId,
                                              boolean kernel,
                                              java.util.Date time)
                                       throws ru.bitel.bgbilling.common.BGException

      Throws:
        `ru.bitel.bgbilling.common.BGException`

    - #### list

          public java.util.List<Product> list(int moduleId,
                                              int contractId,
                                              int accountId,
                                              boolean kernel,
                                              java.util.Date timeFrom,
                                              java.util.Date timeTo,
                                              java.util.Date timeFromIntersect,
                                              java.util.Date timeToIntersect,
                                              boolean needNonActive,
                                              boolean titleLoad)
                                       throws ru.bitel.bgbilling.common.BGException

      Получение списка продуктов договора.
      Parameters:
        `moduleId` - ID модуля, если <0, то продукты всех модулей, ==0 - продукты ядра
        `contractId` - ID договора
        `accountId` -
        `kernel` - включать ли продукты ядра, если moduleId >=0
        `timeFrom` -
        `timeTo` -
        `timeFromIntersect` -
        `timeToIntersect` -
        `needNonActive` -
        `titleLoad` -
      Returns:
      Throws:
        `ru.bitel.bgbilling.common.BGException`

    - #### delete

          public int delete(int contractId,
                            int id)
                     throws ru.bitel.bgbilling.common.BGException

      Throws:
        `ru.bitel.bgbilling.common.BGException`

    - #### updateDeviceState

          public void updateDeviceState(int contractId,
                                        int tvAccountId,
                                        int productId,
                                        java.lang.String deviceProductId,
                                        short deviceState)
                                 throws ru.bitel.bgbilling.common.BGException

      Обновление состояния продукта.
      Parameters:
        `contractId` - ID договора
        `tvAccountId` - ID аккаунта
        `productId` - ID продукта
        `deviceProductId` - новый ID продукта на MW (внешний ID)
        `deviceState` - новое состояние продукта на MW (внешнее состояние)
      Throws:
        `ru.bitel.bgbilling.common.BGException`

    - #### get

          public Product get(int contractId,
                             int id)
                      throws ru.bitel.bgbilling.common.BGException

      Throws:
        `ru.bitel.bgbilling.common.BGException`

    - #### getAndDelete

          public Product getAndDelete(int contractId,
                                      int id)
                               throws ru.bitel.bgbilling.common.BGException

      Throws:
        `ru.bitel.bgbilling.common.BGException`

    - #### recycle

          public void recycle()
                       throws ru.bitel.bgbilling.common.BGException

      Overrides:
        `recycle` in class `ru.bitel.common.dao.AbstractDao<Product>`
      Throws:
        `ru.bitel.bgbilling.common.BGException`

    - #### checkProductSpecDelete

          public void checkProductSpecDelete(int productSpecId)
                                      throws ru.bitel.bgbilling.common.BGException

      Throws:
        `ru.bitel.bgbilling.common.BGException`

    - #### checkProductSpecActivationModeDelete

          public void checkProductSpecActivationModeDelete(int activationModeId)
                                                    throws ru.bitel.bgbilling.common.BGException

      Throws:
        `ru.bitel.bgbilling.common.BGException`