ru.bitel.oss.kernel.entity.server.bean

## Class AbstractEntityDao<E extends Entity>

- java.lang.Object
- - ru.bitel.common.dao.AbstarctDaoConstant
  - - ru.bitel.common.dao.AbstractDao<B>
    - - ru.bitel.common.dao.AbstractIdDao<E>
      - - ru.bitel.oss.kernel.entity.server.bean.AbstractEntityAttrDao<E>
        - - ru.bitel.oss.kernel.entity.server.bean.AbstractEntityDao<E>

- All Implemented Interfaces:
    java.lang.AutoCloseable
  Direct Known Subclasses:
    DeviceDao, ProductSpecDao, ServiceSpecDao, TvChannelSpecDao

      public abstract class AbstractEntityDao<E extends Entity>
      extends AbstractEntityAttrDao<E>

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class ru.bitel.oss.kernel.entity.server.bean.AbstractEntityAttrDao

      `AbstractEntityAttrDao.AddressItemModifiedEventListener`

    - ### 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` | `getImplPS`
    `protected java.sql.PreparedStatement` | `insertEntityPS`
    `protected java.sql.PreparedStatement` | `updateEntityPS`
    `protected java.sql.PreparedStatement` | `updateEntityPS2`

    - ### Fields inherited from class ru.bitel.oss.kernel.entity.server.bean.AbstractEntityAttrDao

      `CONTRACT_OBJECT_SUPPORT, CONTRACT_SUPPORT, ENTITY_SUPPORT, entitySpecAttrDirectory, entitySpecDirectory, filterWeightComparator, userId`

    - ### 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
    `AbstractEntityDao(java.sql.Connection con, int mid, int userId, java.lang.String tableName)`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected int` | `deleteImpl(int id)`
    `protected E` | `getFromRS(java.sql.ResultSet rs, boolean loadAttributes, boolean loadEntityTitle)`
    `protected abstract E` | `getFromRSImpl(java.sql.ResultSet rs)`
    `protected E` | `getImpl(int id)`
    `protected void` | `linkEntity(Entity entity)`
    `protected java.util.List<E>` | `list(boolean loadAttributes, Page page, java.lang.String what, java.lang.String join, java.util.List<FilterEntityAttr> entityFilter, java.lang.String filter, java.lang.String groupBy, java.lang.String orderBy, java.lang.Object... params)`
    `protected Result<E>` | `list(Page page, java.lang.String filter, java.lang.String orderBy, java.lang.Object... params)`
    `protected java.util.List<E>` | `listImpl(Page page, java.lang.String filter, java.lang.String orderBy, java.lang.Object... params)`
    `void` | `recycle()`
    `protected void` | `unlinkEntity(int entityId)`
    `void` | `update(E b)`

    - ### Methods inherited from class ru.bitel.oss.kernel.entity.server.bean.AbstractEntityAttrDao

      `checkEntityAttribute, checkEntitySpecAttrDelete, filterInit, filterJoin, filterToPS, getAllEntityAttributes, getAttribute, getEntityAttribute, getEntityAttributes, getEntitySpecAttrDirectory, getEntitySpecDirectory, getEntityTableName, getEntityValueForIds, getFromRS, listImpl, onAddressItemUpdate, updateEntityAttribute, updateEntityAttributes`

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

      `delete, get, getAndDelete, getAndUpdate`

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

      `close, delete, eq, get, getById, getListFromRS, getPeriod, getSQLOrder, getTableName, list, listImpl, listImplPS, listImplPS, processException, setStatementParam, updateImpl`

    - ### 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

    - #### insertEntityPS

          protected java.sql.PreparedStatement insertEntityPS

    - #### updateEntityPS

          protected java.sql.PreparedStatement updateEntityPS

    - #### updateEntityPS2

          protected java.sql.PreparedStatement updateEntityPS2

    - #### getImplPS

          protected java.sql.PreparedStatement getImplPS

  - ### Constructor Detail

    - #### AbstractEntityDao

          public AbstractEntityDao(java.sql.Connection con,
                                   int mid,
                                   int userId,
                                   java.lang.String tableName)

  - ### Method Detail

    - #### linkEntity

          protected void linkEntity(Entity entity)
                             throws java.sql.SQLException

      Throws:
        `java.sql.SQLException`

    - #### unlinkEntity

          protected void unlinkEntity(int entityId)
                               throws java.sql.SQLException

      Throws:
        `java.sql.SQLException`

    - #### deleteImpl

          protected int deleteImpl(int id)
                            throws ru.bitel.bgbilling.common.BGException

      Overrides:
        `deleteImpl` in class `ru.bitel.common.dao.AbstractDao<E extends Entity>`
      Throws:
        `ru.bitel.bgbilling.common.BGException`

    - #### update

          public void update(E b)
                      throws ru.bitel.bgbilling.common.BGException

      Overrides:
        `update` in class `ru.bitel.common.dao.AbstractDao<E extends Entity>`
      Throws:
        `ru.bitel.bgbilling.common.BGException`

    - #### list

          protected java.util.List<E> list(boolean loadAttributes,
                                           Page page,
                                           java.lang.String what,
                                           java.lang.String join,
                                           java.util.List<FilterEntityAttr> entityFilter,
                                           java.lang.String filter,
                                           java.lang.String groupBy,
                                           java.lang.String orderBy,
                                           java.lang.Object... params)
                                    throws ru.bitel.bgbilling.common.BGException

      Overrides:
        `list` in class `AbstractEntityAttrDao<E extends Entity>`
      Throws:
        `ru.bitel.bgbilling.common.BGException`

    - #### getImpl

          protected E getImpl(int id)
                       throws ru.bitel.bgbilling.common.BGException,
                              java.sql.SQLException

      Overrides:
        `getImpl` in class `ru.bitel.common.dao.AbstractDao<E extends Entity>`
      Throws:
        `ru.bitel.bgbilling.common.BGException`
        `java.sql.SQLException`

    - #### getFromRS

          protected E getFromRS(java.sql.ResultSet rs,
                                boolean loadAttributes,
                                boolean loadEntityTitle)
                         throws java.sql.SQLException,
                                ru.bitel.bgbilling.common.BGException

      Specified by:
        `getFromRS` in class `AbstractEntityAttrDao<E extends Entity>`
      Throws:
        `java.sql.SQLException`
        `ru.bitel.bgbilling.common.BGException`

    - #### getFromRSImpl

          protected abstract E getFromRSImpl(java.sql.ResultSet rs)
                                      throws java.sql.SQLException,
                                             ru.bitel.bgbilling.common.BGException

      Throws:
        `java.sql.SQLException`
        `ru.bitel.bgbilling.common.BGException`

    - #### recycle

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

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

    - #### list

          protected Result<E> list(Page page,
                                   java.lang.String filter,
                                   java.lang.String orderBy,
                                   java.lang.Object... params)
                            throws ru.bitel.bgbilling.common.BGException

      Overrides:
        `list` in class `ru.bitel.common.dao.AbstractDao<E extends Entity>`
      Throws:
        `ru.bitel.bgbilling.common.BGException`

    - #### listImpl

          protected java.util.List<E> listImpl(Page page,
                                               java.lang.String filter,
                                               java.lang.String orderBy,
                                               java.lang.Object... params)
                                        throws ru.bitel.bgbilling.common.BGException,
                                               java.sql.SQLException

      Overrides:
        `listImpl` in class `ru.bitel.common.dao.AbstractDao<E extends Entity>`
      Throws:
        `ru.bitel.bgbilling.common.BGException`
        `java.sql.SQLException`