Example usage for org.springframework.jdbc.core BeanPropertyRowMapper BeanPropertyRowMapper

List of usage examples for org.springframework.jdbc.core BeanPropertyRowMapper BeanPropertyRowMapper

Introduction

In this page you can find the example usage for org.springframework.jdbc.core BeanPropertyRowMapper BeanPropertyRowMapper.

Prototype

public BeanPropertyRowMapper(Class<T> mappedClass) 

Source Link

Document

Create a new BeanPropertyRowMapper , accepting unpopulated properties in the target bean.

Usage

From source file:com.anthony.forumspring.dao.TopicsDao.java

@Override
public List<Topics> findAllByValidation() {
    String sql = "SELECT * FROM TOPICS where validation = 0";
    return jdbcTemplate.query(sql, new BeanPropertyRowMapper(Topics.class));
}

From source file:com.stehno.fixture.interfaces.FindWhereOperation.java

@Override
public Object execute(final String sql, final Object[] params) {
    return getJdbcOperations().query(sql, new BeanPropertyRowMapper<>(Pet.class),
            String.format("%%%s%%", params[0]), ((Pet.Species) params[1]).name());
}

From source file:nbadb.DAO.PlayerJDBCTemplate.java

public List<PlayerDAO> findAll() {
    String SQL = "SELECT * FROM playergeneralstats ORDER BY PPG desc";

    List<PlayerDAO> players = template.query(SQL, new BeanPropertyRowMapper(Player.class));

    return players;
}

From source file:nbadb.DAO.TeamJDBCTemplate.java

public List<TeamDAO> getGameBoxscore(int gameid) {

    String SQL = "SELECT TeamAbbreviation, Q1Points, Q2Points, Q3Points, Q4Points, OT1Points,OT2Points, OT3Points, TotalPoints "
            + "FROM teamboxscore WHERE GameID=" + gameid + "";
    List<TeamDAO> gameheader = template.query(SQL, new BeanPropertyRowMapper(GameBoxScore.class));

    return gameheader;
}

From source file:CRM.repository.UsersDAO.java

public users getUsersByUsername(String username) {
    String sql = "SELECT *  FROM users WHERE username = ?";
    return template.queryForObject(sql, new Object[] { username },
            new BeanPropertyRowMapper<users>(users.class));

}

From source file:com.practice.web.repository.impl.JdbcPersonRepository.java

public Person getPersonById(Integer idPerson) {
    String sql = "select * from person where id = ?";
    return jdbc.queryForObject(sql, new BeanPropertyRowMapper<Person>(Person.class), idPerson);
}

From source file:com.sirti.microservice.hbase.dao.HKpiDaoImpl.java

@Override
public List<HKpi> findAll() {
    String sql = "SELECT * FROM " + hKpiTable;
    List<HKpi> alarms = this.jdbcTemplate.query(sql, new BeanPropertyRowMapper<HKpi>(HKpi.class));
    return alarms;
}

From source file:com.anthony.forumspring.dao.UsersDao.java

@Override
public List<Users> findAllByUsername(String username) {

    String sql = "Select * from users where username = ?";
    return this.jdbcTemplate.query(sql, new Object[] { username }, new BeanPropertyRowMapper(Users.class));

}

From source file:com.clonephpscrapper.dao.ClonePhpDaoImpl.java

@Override
public List<Categories> getCategoriesDataList() {

    List<Categories> CategoriesDataList = null;
    String SQL = "Select * from categories where iscrawled=0";
    try {/*from  w w w  . j a  v a  2s.c o  m*/
        CategoriesDataList = jdbcTemplateObject.query(SQL, new BeanPropertyRowMapper(Categories.class));
        System.out.println("Fetching data");
    } catch (Exception e) {
    }
    return CategoriesDataList;
}

From source file:nbadb.DAO.PlayerJDBCTemplate.java

public List<PlayerDAO> findPlayerBoxscore(int playerid) {
    String SQL = "SELECT * FROM vyy where playerID =" + playerid + "";

    List<PlayerDAO> players = template.query(SQL, new BeanPropertyRowMapper(PlayerBoxScore.class));

    return players;
}