List of usage examples for org.apache.commons.dbutils.handlers BeanHandler BeanHandler
public BeanHandler(Class<T> type)
From source file:com.pinterest.clusterservice.db.DBClusterDAOImpl.java
@Override public ClusterBean getByClusterName(String clusterName) throws Exception { ResultSetHandler<ClusterBean> h = new BeanHandler<ClusterBean>(ClusterBean.class); return new QueryRunner(dataSource).query(GET_CLUSTER_CONFIG, h, clusterName); }
From source file:com.pinterest.deployservice.db.DBTagDAOImpl.java
@Override public TagBean getById(String id) throws Exception { return new QueryRunner(basicDataSource).query(GET_TAG_BY_ID_TEMPLATE, new BeanHandler<>(TagBean.class), id); }
From source file:com.pinterest.deployservice.db.DBAgentErrorDAOImpl.java
@Override public AgentErrorBean getByHostIdAndEnvId(String hostId, String envId) throws Exception { ResultSetHandler<AgentErrorBean> h = new BeanHandler<AgentErrorBean>(AgentErrorBean.class); return new QueryRunner(dataSource).query(GET_ERROR_BY_HOSTID_AND_ENVID, h, hostId, envId); }
From source file:com.pinterest.deployservice.db.DBScheduleDAOImpl.java
@Override public ScheduleBean getById(String scheduleId) throws Exception { ResultSetHandler<ScheduleBean> h = new BeanHandler<ScheduleBean>(ScheduleBean.class); ScheduleBean bean = new QueryRunner(dataSource).query(GET_SCHEDULE_BY_ID, h, scheduleId); return bean;/* w ww. j a va2 s.co m*/ }
From source file:com.pinterest.arcee.db.DBAlarmDAOImpl.java
@Override public AsgAlarmBean getAlarmInfoByGroupAndMetricSource(String groupName, String metricSource) throws Exception { ResultSetHandler<AsgAlarmBean> h = new BeanHandler<AsgAlarmBean>(AsgAlarmBean.class); return new QueryRunner(dataSource).query(GET_BY_GROUP_AND_METRICSOURCE, h, groupName, metricSource); }
From source file:com.netradius.hibernate.support.EncryptedStringUserTypeTest.java
public Record getRecord(Long id) throws SQLException { return query("SELECT * FROM data WHERE id = ?", new BeanHandler<Record>(Record.class), id); }
From source file:com.softberries.klerk.dao.ProductDao.java
public Product find(Long id, QueryRunner run1, Connection conn1) throws SQLException { Product p = null;// w ww . java 2s. c o m try { init(); ResultSetHandler<Product> h = new BeanHandler<Product>(Product.class); p = run1.query(conn1, SQL_FIND_PRODUCT_BY_ID, h, id); } catch (ClassNotFoundException e) { e.printStackTrace(); } return p; }
From source file:com.pinterest.arcee.db.DBGroupMappingDAOImpl.java
@Override public GroupMappingBean getGroupMappingByAsgGroupName(String asgGroupName) throws Exception { ResultSetHandler<GroupMappingBean> h = new BeanHandler<>(GroupMappingBean.class); return new QueryRunner(dataSource).query(GET_GROUP_MAPPING_BY_ASG, h, asgGroupName); }
From source file:com.netradius.hibernate.support.EncryptedBytesUserTypeTest.java
public Record getRecord(long id) throws SQLException { return query("SELECT * FROM data WHERE id = ?", new BeanHandler<Record>(Record.class), id); }
From source file:com.pinterest.deployservice.db.DBUserRolesDAOImpl.java
@Override public UserRolesBean getByNameAndResource(String userName, String resourceId, Resource.Type resourceType) throws Exception { ResultSetHandler<UserRolesBean> h = new BeanHandler<>(UserRolesBean.class); return new QueryRunner(dataSource).query(GET_BY_NAME_AND_RESOURCE, h, userName, resourceId, resourceType.toString());/* w ww. j av a2 s . c o m*/ }