Class StoreDAO

java.lang.Object
ru.bgcrm.dao.CommonDAO
org.bgerp.plugin.inventory.dao.StoreDAO

public class StoreDAO extends CommonDAO
DAO for Store (warehouses). Also handles inventory_balance read operations.
  • Constructor Details

  • Method Details

    • getList

      public List<Store> getList(boolean includeDeleted) throws SQLException
      Throws:
      SQLException
    • get

      public Store get(int id) throws SQLException
      Throws:
      SQLException
    • update

      public void update(Store store, int userId) throws SQLException
      Throws:
      SQLException
    • delete

      public void delete(int id, int userId) throws SQLException
      Throws:
      SQLException
    • getIdsByOwner

      public Set<Integer> getIdsByOwner(int userId) throws SQLException
      Returns IDs of non-deleted stores personally owned by the given user (store.user_id).
      Throws:
      SQLException
    • getIdsByEditGroupIds

      public Set<Integer> getIdsByEditGroupIds(Set<Integer> groupIds) throws SQLException
      Returns IDs of non-deleted stores whose edit_group_id is one of the given groups — e.g. a "кладовщик" group shared by several users managing the same store.
      Throws:
      SQLException
    • getIdByExtIdParam

      public int getIdByExtIdParam(int extIdParamId, String extId) throws SQLException
      Looks up a store by ext_id parameter value in param_text.
      Parameters:
      extIdParamId - param_id of the ext_id parameter (configured per instance)
      extId - external ID value to search
      Returns:
      store id, or 0 if not found
      Throws:
      SQLException
    • getAvailable

      public BigDecimal getAvailable(int storeId, int itemId) throws SQLException
      Gets available (quantity - reserved) balance for an item in a store. Returns 0 if no balance record exists.
      Throws:
      SQLException
    • fromRs

      public static Store fromRs(ResultSet rs) throws SQLException
      Throws:
      SQLException