List of usage examples for org.apache.ibatis.session SqlSession selectOne
<T> T selectOne(String statement, Object parameter);
From source file:com.sec.ose.airs.persistence.protex.CacheKBMapperImpl.java
License:Open Source License
@Override public String getComponentIDByName(String componentName) { SqlSession session = factory.openSession(true); String result = null;/*from w w w . j a v a 2 s. c om*/ try { result = session.selectOne("getComponentIDByName", componentName); } catch (TooManyResultsException e) { log.info(e.getMessage()); return null; } finally { session.close(); } return result; }
From source file:com.sec.ose.airs.persistence.protex.CacheKBMapperImpl.java
License:Open Source License
@Override public String getComponentVersionIDByComponentIDAndVersionName(String componentId, String componentVersionName) { SqlSession session = factory.openSession(true); String result;// www .j a va 2s. co m HashMap<String, String> map = new HashMap<String, String>(); map.put("componentId", componentId); map.put("componentVersionName", componentVersionName); try { result = session.selectOne("getComponentVersionIDByComponentIDAndVersionName", map); } catch (TooManyResultsException e) { log.info(e.getMessage()); return null; } finally { session.close(); } return result; }
From source file:com.sec.ose.airs.persistence.protex.CacheKBMapperImpl.java
License:Open Source License
@Override public String getLicenseIDByName(String licenseName) { SqlSession session = factory.openSession(true); String result;//from w ww. j a va 2 s.com try { result = session.selectOne("getLicenseIDByName", licenseName); } finally { session.close(); } return result; }
From source file:com.sec.ose.airs.persistence.protex.CacheKBMapperImpl.java
License:Open Source License
@Override public String getLicenseNameByID(String licenseId) { SqlSession session = factory.openSession(true); String result;/* www.j a v a 2s. c o m*/ try { result = session.selectOne("getLicenseNameByID", licenseId); } finally { session.close(); } return result; }
From source file:com.sec.ose.airs.persistence.protex.CacheKBMapperImpl.java
License:Open Source License
@Override public String getComponentIDByNameAndLicenseIDAndVersionName(String componentName, String licenseId, String versionName) {//from ww w . j a v a2 s .c om SqlSession session = factory.openSession(true); String result; HashMap<String, String> map = new HashMap<String, String>(); map.put("componentName", componentName); map.put("licenseId", licenseId); map.put("versionName", versionName); try { result = session.selectOne("getComponentIDByNameAndLicenseIDAndVersionName", map); } catch (TooManyResultsException e) { log.info(e.getMessage()); return null; } finally { session.close(); } return result; }
From source file:com.sec.ose.airs.persistence.protex.CacheKBMapperImpl.java
License:Open Source License
@Override public String getComponentIDByNameAndVersionName(String componentName, String versionName) { SqlSession session = factory.openSession(true); String result;//from w w w. ja va 2s . c o m HashMap<String, String> map = new HashMap<String, String>(); map.put("componentName", componentName); map.put("versionName", versionName); try { result = session.selectOne("getComponentIDByNameAndVersionName", map); } catch (TooManyResultsException e) { log.info(e.getMessage()); return null; } finally { session.close(); } return result; }
From source file:com.sec.ose.airs.persistence.protex.CacheKBMapperImpl.java
License:Open Source License
@Override public ProtexIdentificationInfo getComponentIDAndVersionIDWithNames(String componentName, String versionName) { SqlSession session = factory.openSession(true); ProtexIdentificationInfo result = null; HashMap<String, Object> map = new HashMap<String, Object>(); map.put("componentName", componentName); map.put("versionName", versionName); try {/*from w w w . j a va2s.co m*/ result = session.selectOne("getComponentIDAndVersionIDWithNames", map); } catch (TooManyResultsException e) { log.info(e.getMessage()); return null; } finally { session.close(); } return result; }
From source file:com.sec.ose.airs.persistence.protex.CacheKBMapperImpl.java
License:Open Source License
@Override public ProtexIdentificationInfo getComponentVersionNamesWithIDs(String componentID, String versionID) { SqlSession session = factory.openSession(true); ProtexIdentificationInfo result = null; HashMap<String, Object> map = new HashMap<String, Object>(); map.put("componentID", componentID); map.put("versionID", versionID); try {//ww w. ja va 2 s. c o m result = session.selectOne("getComponentVersionNamesWithIDs", map); } catch (TooManyResultsException e) { log.info(e.getMessage()); return null; } finally { session.close(); } return result; }
From source file:com.sec.ose.airs.persistence.SPDXMapperImpl.java
License:Open Source License
@Override public SPDXPackageDTO getPackage(int id) { SqlSession session = factory.openSession(true); SPDXPackageDTO result;/*from ww w. j a v a 2s . co m*/ try { result = session.selectOne("getPackage", id); } finally { session.close(); } return result; }
From source file:com.spring.dao.CiudadDAOImpl.java
@Override public Ciudad search(Ciudad c) { Ciudad list = new Ciudad(); SqlSession session = new MyBatisUtil().getSession(); try {/* w w w .jav a2 s. com*/ list = session.selectOne("Ciudad.search", c); } finally { session.close(); } return list; }