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

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<D>
ru.bitel.oss.systems.inventory.resource.server.bean.DeviceDao<D,​T>
All Implemented Interfaces:
java.lang.AutoCloseable
Direct Known Subclasses:
InvDeviceDao, TvDeviceDao, VoiceDeviceDao

public abstract class DeviceDao<D extends Device<D,​T>,​T extends DeviceType>
extends AbstractEntityDao<D>
  • Constructor Details

    • DeviceDao

      public DeviceDao​(java.sql.Connection con, int moduleId, int userId, java.lang.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, java.lang.String title)
    • getTypeDir

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

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

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

      public void update​(D b) throws ru.bitel.bgbilling.common.BGException
      Overrides:
      update in class AbstractEntityDao<D extends Device<D,​T>>
      Throws:
      ru.bitel.bgbilling.common.BGException
    • updateImpl

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

      protected int setExtraParams​(D device, java.sql.PreparedStatement ps, int idx) throws java.sql.SQLException
      Throws:
      java.sql.SQLException
    • getValues

      protected java.util.List<java.lang.String> getValues()
    • list

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

      public java.util.List<D> list​(int deviceTypeId, boolean loadDeviceGroupLink) throws ru.bitel.bgbilling.common.BGException
      Throws:
      ru.bitel.bgbilling.common.BGException
    • root

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

      public D root​(java.lang.String identifier, java.lang.String host, java.util.Set<java.lang.Integer> deviceTypeIds, java.util.Set<java.lang.Integer> deviceGroupIds, java.util.Date dateFrom, java.util.Date dateTo, java.util.Date intersectDateFrom, java.util.Date intersectDateTo, java.util.List<FilterEntityAttr> entityFilter, boolean loadDeviceGroupLink) 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​(java.util.List<FilterEntityAttr> entityFilter, int deviceId, boolean loadDeviceGroupLink) throws ru.bitel.bgbilling.common.BGException
      Throws:
      ru.bitel.bgbilling.common.BGException
    • node

      public D node​(java.util.List<FilterEntityAttr> entityFilter, int deviceId, java.lang.String filter, boolean loadDeviceGroupLink) throws ru.bitel.bgbilling.common.BGException
      Throws:
      ru.bitel.bgbilling.common.BGException
    • getTreeFromList

      protected D getTreeFromList​(java.util.List<D> deviceList, int deviceId)
    • move

      public void move​(int newParentId, java.util.Set<java.lang.Integer> children) throws ru.bitel.bgbilling.common.BGException
      Throws:
      ru.bitel.bgbilling.common.BGException
    • updateUptime

      public void updateUptime​(int id, java.lang.String uptime, java.util.Date uptimeTime) throws ru.bitel.bgbilling.common.BGException
      Throws:
      ru.bitel.bgbilling.common.BGException
    • listByUptimeTime

      public java.util.List<D> listByUptimeTime​(java.util.Date uptimeTime, java.lang.String orderBy, Page page) throws ru.bitel.bgbilling.common.BGException
      Throws:
      ru.bitel.bgbilling.common.BGException
    • listByType

      public java.util.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
      Overrides:
      deleteImpl in class ru.bitel.common.dao.AbstractDao<D extends Device<D,​T>>
      Throws:
      ru.bitel.bgbilling.common.BGException