Package ru.bitel.oss.systems.inventory.resource.server.bean

# Class DeviceDao<D extends Device<D,T>,T extends DeviceType>

java.lang.Object
ru.bitel.bgbilling.kernel.base.server.logger.BGLogger
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<D>
ru.bitel.oss.systems.inventory.resource.server.bean.DeviceDao<D,T>

All Implemented Interfaces:
  `AutoCloseable`

Direct Known Subclasses:
  `InvDeviceDao`, `TvDeviceDao`, `VoiceDeviceDao`

public abstract class DeviceDao<D extends Device<D,T>,T extends DeviceType> extends AbstractEntityDao<D>

- ## 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
  Description
  `protected final String`
  `TABLE_INV_DEVICE_GROUP_LINK`

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

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

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

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

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

  `ERROR, fields, SQL_ALL, SQL_AND, SQL_CALC_FOUND_ROWS, 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_ON_DUPLICATE_KEY_UPDATE, SQL_ORDER, SQL_SELECT, SQL_SET, SQL_UPDATE, SQL_VALUES, SQL_WHERE`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DeviceDao(Connection con, int moduleId, int userId, String tableName, EntityAttrDaoSupport entityAttrDaoSupport)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected int`
  `deleteImpl(int id)`
  `<T extends DeviceType, D extends Device<D, T>>
  void`
  `getFromRS(ResultSet rs, Directory<T> deviceTypeDir, T folderType, PreparedStatement getGroupsPS, D result)`
  `protected D`
  `getFromRSImpl(ResultSet rs)`
  `protected D`
  `getTreeFromList(List<D> deviceList, int deviceId)`
  `protected abstract Directory<T>`
  `getTypeDir()`
  `protected List<String>`
  `getValues()`
  `List<D>`
  `list(int deviceTypeId, boolean loadDeviceGroupLink)`
  `List<D>`
  `list(List<FilterEntityAttr> entityFilter, boolean loadDeviceGroupLink)`
  `List<D>`
  `listByType(int deviceTypeId, boolean loadDeviceGroupLink)`
  `List<D>`
  `listByUptimeTime(Date uptimeTime, String orderBy, Page page)`
  `void`
  `move(int newParentId, Set<Integer> children)`
  `protected abstract D`
  `newDevice()`
  `protected abstract T`
  `newDeviceType(int id, String title)`
  `D`
  `node(List<FilterEntityAttr> entityFilter, int deviceId, boolean loadDeviceGroupLink)`
  `D`
  `node(List<FilterEntityAttr> entityFilter, int deviceId, String filter, boolean loadDeviceGroupLink)`
  `D`
  `root(String identifier, String host, int deviceType, Set<Integer> deviceGroupIds, List<FilterEntityAttr> entityFilter)`
  Deprecated.
  `D`
  `root(DeviceTreeFilter deviceTreeFilter)`
  `protected int`
  `setExtraParams(D device, PreparedStatement ps, int idx)`
  `protected void`
  `updateImpl(D b)`
  `void`
  `updateUptime(int id, String uptime, Date uptimeTime)`

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

  `delete, getFromRS, getFromRS, linkEntity, list, list, listImpl, unlinkEntity, update`

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

  `checkEntityAttribute, checkEntitySpecAttrDelete, deleteEntityAttribute, deleteEntityAttributes, filterInit, filterJoin, filterToPS, getAllEntityAttributes, getAttribute, getEntityAttribute, getEntityAttributes, getEntityAttributes, getEntitySpecAttrDirectory, getEntitySpecDirectory, getEntityTableName, getEntityTableSuffix, getEntityValueForIds, listImpl, onAddressItemUpdate, optEntityAttribute, updateEntityAttribute, updateEntityAttributes`

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

  `executeUpdate, get, getAndDelete, getAndUpdate, opt`

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

  `close, delete, dropTemporaryTable, eq, get, getById, getImpl, getListFromRS, getPeriod, getQueryById, getSQLOrder, getTableName, list, listImpl, listImplPS, listImplPS, loadData, ormFromResultSet, ormUpdateImpl, ormUpdateImpl, ormUpdateImpl, ormUpdateImpl, processException, setPageRecordCount, setStatementParam`

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

  `getSQLOrder, psSetDate, psSetInt, psSetString, sqlLimit`

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

  `error, error, error, getLogger, logError, logError`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### TABLE_INV_DEVICE_GROUP_LINK

    protected final String TABLE_INV_DEVICE_GROUP_LINK

- ## Constructor Details

  - ### DeviceDao

    public DeviceDao(Connection con, int moduleId, int userId, String tableName, EntityAttrDaoSupport entityAttrDaoSupport) throws ru.bitel.bgbilling.common.BGException
    Throws:
      `ru.bitel.bgbilling.common.BGException`

- ## Method Details

  - ### newDevice

    protected abstract D newDevice()

  - ### newDeviceType

    protected abstract T newDeviceType(int id, String title)

  - ### getTypeDir

    protected abstract Directory<T> getTypeDir() throws ru.bitel.bgbilling.common.BGException
    Throws:
      `ru.bitel.bgbilling.common.BGException`

  - ### getFromRSImpl

    protected D getFromRSImpl(ResultSet rs) throws SQLException, ru.bitel.bgbilling.common.BGException
    Specified by:
      `getFromRSImpl` in class `AbstractEntityDao<D extends Device<D,T>>`
    Throws:
      `SQLException`
      `ru.bitel.bgbilling.common.BGException`

  - ### getFromRS

    public <T extends DeviceType, D extends Device<D, T>> void getFromRS(ResultSet rs, Directory<T> deviceTypeDir, T folderType, PreparedStatement getGroupsPS, D result) throws SQLException, ru.bitel.bgbilling.common.BGException
    Throws:
      `SQLException`
      `ru.bitel.bgbilling.common.BGException`

  - ### updateImpl

    protected void updateImpl(D b) throws ru.bitel.bgbilling.common.BGException, SQLException
    Specified by:
      `updateImpl` in class `ru.bitel.common.dao.AbstractDao<D extends Device<D,T>>`
    Throws:
      `ru.bitel.bgbilling.common.BGException`
      `SQLException`

  - ### setExtraParams

    protected int setExtraParams(D device, PreparedStatement ps, int idx) throws SQLException
    Throws:
      `SQLException`

  - ### getValues

    protected List<String> getValues()

  - ### list

    public List<D> list(List<FilterEntityAttr> entityFilter, boolean loadDeviceGroupLink) throws ru.bitel.bgbilling.common.BGException
    Throws:
      `ru.bitel.bgbilling.common.BGException`

  - ### list

    public List<D> list(int deviceTypeId, boolean loadDeviceGroupLink) throws ru.bitel.bgbilling.common.BGException
    Throws:
      `ru.bitel.bgbilling.common.BGException`

  - ### root

    @Deprecated public D root(String identifier, String host, int deviceType, Set<Integer> deviceGroupIds, List<FilterEntityAttr> entityFilter) throws ru.bitel.bgbilling.common.BGException
    Deprecated.
    Throws:
      `ru.bitel.bgbilling.common.BGException`

  - ### root

    public D root(DeviceTreeFilter deviceTreeFilter) throws ru.bitel.bgbilling.common.BGException
    Parameters:
      `identifier` -
      `host` -
      `deviceType` - -1 - любой, 0-папка или код типа устройства
      `deviceGroupIds` -
      `entityFilter` -
    Returns:
    Throws:
      `ru.bitel.bgbilling.common.BGException`

  - ### node

    public D node(List<FilterEntityAttr> entityFilter, int deviceId, boolean loadDeviceGroupLink) throws ru.bitel.bgbilling.common.BGException
    Throws:
      `ru.bitel.bgbilling.common.BGException`

  - ### node

    public D node(List<FilterEntityAttr> entityFilter, int deviceId, String filter, boolean loadDeviceGroupLink) throws ru.bitel.bgbilling.common.BGException
    Throws:
      `ru.bitel.bgbilling.common.BGException`

  - ### getTreeFromList

    protected D getTreeFromList(List<D> deviceList, int deviceId)

  - ### move

    public void move(int newParentId, Set<Integer> children) throws ru.bitel.bgbilling.common.BGException
    Throws:
      `ru.bitel.bgbilling.common.BGException`

  - ### updateUptime

    public void updateUptime(int id, String uptime, Date uptimeTime) throws ru.bitel.bgbilling.common.BGException
    Throws:
      `ru.bitel.bgbilling.common.BGException`

  - ### listByUptimeTime

    public List<D> listByUptimeTime(Date uptimeTime, String orderBy, Page page) throws ru.bitel.bgbilling.common.BGException
    Throws:
      `ru.bitel.bgbilling.common.BGException`

  - ### listByType

    public List<D> listByType(int deviceTypeId, boolean loadDeviceGroupLink) throws ru.bitel.bgbilling.common.BGException
    Throws:
      `ru.bitel.bgbilling.common.BGException`

  - ### deleteImpl

    protected int deleteImpl(int id) throws ru.bitel.bgbilling.common.BGException, SQLException
    Overrides:
      `deleteImpl` in class `ru.bitel.common.dao.AbstractDao<D extends Device<D,T>>`
    Throws:
      `ru.bitel.bgbilling.common.BGException`
      `SQLException`