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