日期:2014-05-16  浏览次数:20334 次

spring的jdbcTemplate 返回一个类



public HomeMember findUserById(int id) {
		homeMember = null;
		try {
			homeMember = (HomeMember) jdbcTemplate.queryForObject(
					"SELECT * FROM uchome_member WHERE uid = ?",
					new Object[] { id },
					com.qieast.platform.model.HomeMember.class);
		} catch (DataAccessException e) {
			e.printStackTrace(); 
		}
		entityManager.persist(homeMember);
		return homeMember;
	}