List of usage examples for org.springframework.jdbc.core SingleColumnRowMapper SingleColumnRowMapper
public SingleColumnRowMapper()
From source file:org.ohmage.query.impl.ClassQueries.java
@Override public List<String> getAllClassIds() throws DataAccessException { try {/*from ww w. ja v a 2 s . co m*/ return getJdbcTemplate().query(SQL_GET_ALL_CLASS_IDS, new SingleColumnRowMapper<String>()); } catch (org.springframework.dao.DataAccessException e) { throw new DataAccessException("Error executing SQL '" + SQL_GET_ALL_CLASS_IDS, e); } }
From source file:org.ohmage.query.impl.UserCampaignQueries.java
/** * Retrieves all of the users from a campaign. * //from w ww . jav a 2s . c o m * @param campaignId The unique identifier for the campaign. * * @return A List of usernames for the users in the campaign. */ public List<String> getUsersInCampaign(String campaignId) throws DataAccessException { try { return getJdbcTemplate().query(SQL_GET_USERS_IN_CAMPAIGN, new Object[] { campaignId }, new SingleColumnRowMapper<String>()); } catch (org.springframework.dao.DataAccessException e) { throw new DataAccessException( "Error executing SQL '" + SQL_GET_USERS_IN_CAMPAIGN + "' with parameter: " + campaignId, e); } }
From source file:org.ohmage.query.impl.ClassQueries.java
@Override public List<String> getClassIdsFromPartialId(String partialId) throws DataAccessException { try {// w w w.ja v a 2 s . c om return getJdbcTemplate().query(SQL_GET_LIKE_CLASS_ID, new Object[] { "%" + partialId + "%" }, new SingleColumnRowMapper<String>()); } catch (org.springframework.dao.DataAccessException e) { throw new DataAccessException( "Error executing SQL '" + SQL_GET_LIKE_CLASS_ID + "' with parameter: " + "%" + partialId + "%", e); } }
From source file:org.cateproject.features.FeatureStoreSpringJDBC.java
/** {@inheritDoc} */ @Override/*from w ww . j av a2 s .c om*/ public Set<String> readAllGroups() { Set<String> setOfGroup = new HashSet<String>(); setOfGroup.addAll(getJdbcTemplate().query(SQLQUERY_ALLGROUPS, new SingleColumnRowMapper<String>())); setOfGroup.remove(null); setOfGroup.remove(""); return setOfGroup; }
From source file:org.ohmage.query.impl.ClassQueries.java
@Override public List<String> getClassIdsFromPartialName(String partialName) throws DataAccessException { try {// w w w . j a v a 2 s. c o m return getJdbcTemplate().query(SQL_GET_LIKE_CLASS_NAME, new Object[] { "%" + partialName + "%" }, new SingleColumnRowMapper<String>()); } catch (org.springframework.dao.DataAccessException e) { throw new DataAccessException("Error executing SQL '" + SQL_GET_LIKE_CLASS_ID + "' with parameter: " + "%" + partialName + "%", e); } }
From source file:org.ohmage.query.impl.AuditQueries.java
@Override public List<Long> getAllAudits() throws DataAccessException { try {/*from w ww . ja v a 2 s. c o m*/ return getJdbcTemplate().query(SQL_GET_AUDIT_IDS, new SingleColumnRowMapper<Long>()); } catch (org.springframework.dao.DataAccessException e) { throw new DataAccessException("Error executing SQL '" + SQL_GET_AUDIT_IDS + "'", e); } }
From source file:org.ohmage.query.impl.ClassQueries.java
@Override public List<String> getClassIdsFromPartialDescription(String partialDescription) throws DataAccessException { try {//from w w w. j a v a2 s. co m return getJdbcTemplate().query(SQL_GET_LIKE_CLASS_DESCRIPTION, new Object[] { "%" + partialDescription + "%" }, new SingleColumnRowMapper<String>()); } catch (org.springframework.dao.DataAccessException e) { throw new DataAccessException("Error executing SQL '" + SQL_GET_LIKE_CLASS_ID + "' with parameter: " + "%" + partialDescription + "%", e); } }
From source file:org.ohmage.query.impl.AuditQueries.java
@Override public List<Long> getAllAuditsWithRequestType(RequestServlet.RequestType requestType) throws DataAccessException { try {/*www . j a va 2s. c o m*/ return getJdbcTemplate().query(SQL_GET_AUDIT_IDS_WITH_TYPE, new Object[] { requestType.name().toLowerCase() }, new SingleColumnRowMapper<Long>()); } catch (org.springframework.dao.DataAccessException e) { throw new DataAccessException("Error executing SQL '" + SQL_GET_AUDIT_IDS_WITH_TYPE + "' with parameter: " + requestType.name().toLowerCase(), e); } }
From source file:org.ff4j.store.FeatureStoreSpringJdbc.java
/** {@inheritDoc} */ public Set<String> readAllGroups() { Set<String> setOfGroup = new HashSet<String>(); setOfGroup.addAll(/*from w w w . ja v a 2 s . c o m*/ getJdbcTemplate().query(getQueryBuilder().getAllGroups(), new SingleColumnRowMapper<String>())); setOfGroup.remove(null); setOfGroup.remove(""); return setOfGroup; }
From source file:org.ohmage.query.impl.AuditQueries.java
public List<Long> getAllAuditsWithUri(URI uri) throws DataAccessException { try {/*from w ww . j a v a 2 s . c o m*/ return getJdbcTemplate().query(SQL_GET_AUDIT_IDS_WITH_URI, new Object[] { uri.toString() }, new SingleColumnRowMapper<Long>()); } catch (org.springframework.dao.DataAccessException e) { throw new DataAccessException( "Error executing SQL '" + SQL_GET_AUDIT_IDS_WITH_URI + "' with parameter: " + uri, e); } }