Class StoreAccessDAO

java.lang.Object
ru.bgcrm.dao.CommonDAO
org.bgerp.plugin.inventoru.dao.StoreAccessDAO

public class StoreAccessDAO extends CommonDAO
DAO for inventoru_store_access — access periods to warehouses, granted either to a user or to a user group.
  • Constructor Details

    • StoreAccessDAO

      public StoreAccessDAO(Connection con)
  • Method Details

    • getList

      public List<StoreAccess> getList(int storeId) throws SQLException
      Returns all access records for a given store (for admin UI).
      Throws:
      SQLException
    • getActiveStoreIds

      public Set<Integer> getActiveStoreIds(int userId, Set<Integer> groupIds, Date date) throws SQLException
      Returns store IDs accessible on a given date to the user personally or to any of the groups they are in. A null date_to means indefinite access.
      Parameters:
      groupIds - the user's groups, may be empty — then only personal grants count.
      Throws:
      SQLException
    • add

      public void add(int storeId, int userId, int groupId, Date dateFrom, Date dateTo) throws SQLException
      Inserts an access record granted either to a user or to a group — the other ID is 0.
      Throws:
      SQLException
    • delete

      public void delete(int id) throws SQLException
      Deletes an access record by id.
      Throws:
      SQLException
    • closePeriod

      public void closePeriod(int id, Date closeTo) throws SQLException
      Closes the open period (sets date_to) for the record identified by id.
      Throws:
      SQLException