Beispiel #1
0
 private <K, V> Map<K, V> executeForMap(SqlSession sqlSession, Object[] args) {
   Map<K, V> result;
   Object param = method.convertArgsToSqlCommandParam(args);
   if (method.hasRowBounds()) {
     RowBounds rowBounds = method.extractRowBounds(args);
     result = sqlSession.<K, V>selectMap(command.getName(), param, method.getMapKey(), rowBounds);
   } else {
     result = sqlSession.<K, V>selectMap(command.getName(), param, method.getMapKey());
   }
   return result;
 }
 /**
  * Return list of integer containing PK for all rules
  *
  * @return
  * @throws PersistenceException
  */
 public HashMap getAllPKandSource() throws PersistenceException {
   HashMap hMap = new HashMap();
   SqlSession session = sf.openSession();
   try {
     hMap =
         (HashMap)
             session.selectMap(
                 "com.cockpitconfig.objects.CommunicationMapper.getAllPKAndSources", "id");
     if (hMap == null) {
       throw new PersistenceException();
     }
   } finally {
     session.close();
   }
   return hMap;
 }
 public <K, V> Map<K, V> selectMap(
     String statement, Object parameter, String mapKey, RowBounds rowBounds) {
   reset();
   return session.selectMap(statement, parameter, mapKey, rowBounds);
 }
 public <K, V> Map<K, V> selectMap(String statement, String mapKey) {
   reset();
   return session.selectMap(statement, mapKey);
 }
 public Map<String, LocationInfo> getLocationListJSON2(String areaName) {
   Map<String, LocationInfo> locationMap = new HashMap<String, LocationInfo>();
   locationMap = sqlSession.selectMap("Mapper.getLocationInfo", "locationName");
   return locationMap;
 }