List of usage examples for org.springframework.jdbc.core.namedparam BeanPropertySqlParameterSource BeanPropertySqlParameterSource
public BeanPropertySqlParameterSource(Object object)
From source file:net.noday.d4c.dao.SubdomainDao.java
public List<Subdomain> findPage(Subdomain condition, int pIndex, int pSize) { StringBuffer sql = new StringBuffer("select * from domain d where 1=1"); SqlParameterSource ps = null;/*from w w w . j a v a 2s . co m*/ if (condition != null) { ps = new BeanPropertySqlParameterSource(condition); sql.append(toConditionSql(condition)); } sql.append(" order by d.regist_time desc").append(" limit ").append((pIndex - 1) * pSize).append(",") .append(pSize); List<Subdomain> list = namedJdbc.query(sql.toString(), ps, new BeanPropertyRowMapper<Subdomain>(Subdomain.class)); return list; }
From source file:cz.dasnet.dasik.dao.LearnDaoImpl.java
public void addLearn(Learn learn) { String sql = "INSERT INTO learns " + "(user_id, `trigger`, reply, type, channel, created) VALUES " + "(:userId, :trigger, :reply, :type, :channel, :created)"; SqlParameterSource learnParameters = new BeanPropertySqlParameterSource(learn); update(sql, learnParameters);//from ww w . j a v a 2 s . c o m }
From source file:com.seovic.coherence.util.persistence.AbstractJdbcCacheStore.java
/** * Persist a single object into the data store. * * @param key entry key of the object that should be persisted * @param value object to persist//from w ww . j ava2 s . co m */ public void store(Object key, Object value) { getJdbcTemplate().update(getMergeSql(), new BeanPropertySqlParameterSource(value)); }
From source file:com.example.dfa.demo.service.DfaDemoServiceImpl.java
@Override public Collection<DfaWorkflowsDTO> findWorkflows(DfaFindDTO criteria) { SqlParameterSource inParams = new BeanPropertySqlParameterSource(criteria); Map<String, Object> out = findWorkflowsSpaCall.execute(inParams); Collection<DfaWorkflowsDTO> workflows = (Collection) out.get("workflows"); return workflows; }
From source file:ru.org.linux.edithistory.EditHistoryDao.java
/** * * @param editHistoryDto */ public void insert(EditHistoryDto editHistoryDto) { editInsert.execute(new BeanPropertySqlParameterSource(editHistoryDto)); }
From source file:net.noday.d4c.dao.DnsrecordDao.java
public int findCount(DnsRecord condition) { StringBuffer sql = new StringBuffer("select count(r.id) from dnsrecord r where 1=1"); SqlParameterSource ps = null;/*from w w w . java 2 s . c o m*/ if (condition != null) { ps = new BeanPropertySqlParameterSource(condition); sql.append(toConditionSql(condition)); } return namedjdbc.queryForInt(sql.toString(), ps); }
From source file:cz.dasnet.dasik.dao.UserDaoImpl.java
public void addUser(User user) { String sql = "INSERT INTO users " + "(mask, words, words_daily, access, lastseen, lastseen_action, lastseen_nick) VALUES " + "(:mask, :words, :wordsDaily, :access, :lastseen, :lastseenAction, :lastseenNick)"; SqlParameterSource userParameters = new BeanPropertySqlParameterSource(user); update(sql, userParameters);//from w w w.j a v a2s . c om invalidateUser(user.getMask()); }
From source file:net.noday.d4c.dao.DomainDao.java
public int findCount(Domain condition) { StringBuffer sql = new StringBuffer("select count(d.id) from domain d where 1=1"); SqlParameterSource ps = null;//from ww w . ja v a 2s. c o m if (condition != null) { ps = new BeanPropertySqlParameterSource(condition); sql.append(toConditionSql(condition)); } return namedJdbc.queryForInt(sql.toString(), ps); }
From source file:org.openlmis.performancetesting.dao.FacilityDAO.java
public long insertGeoZone(GeographicZone geoZone) { GeneratedKeyHolder keyHolder = new GeneratedKeyHolder(); template.update(insertGeoZoneQuery, new BeanPropertySqlParameterSource(geoZone), keyHolder, new String[] { "id" }); long autoGeneratedKey = keyHolder.getKey().longValue(); geoZone.setId(autoGeneratedKey);/*from w w w. ja va2 s . c o m*/ return autoGeneratedKey; }
From source file:airport.database.services.statistics.StatisticsDaoImpl.java
@Override public Statistics getStatisticsUser(User user) { SqlParameterSource parameterSource = new BeanPropertySqlParameterSource(user); return jdbcTemplate.queryForObject(SQL_QUERY_SELECT_FOR_USER, parameterSource, new StatisticsRowMapper()); }