Package org.openqreg.bean

Examples of org.openqreg.bean.SortrowBean


* @return A populated SortrowBean
*
* @throws SQLException
*/
protected static SortrowBean populate(ResultSet rs) throws SQLException {
SortrowBean valueObject = new SortrowBean();
valueObject.setUserid((String)rs.getObject(1));
valueObject.setListname((String)rs.getObject(2));
valueObject.setRowvalue((String)rs.getObject(3));
valueObject.setRoworder((Integer)rs.getObject(4));
return valueObject;
}
View Full Code Here


* @throws SQLException
*/
public static Collection<SortrowBean> findAll(Connection con) throws SQLException {
PreparedStatement pStmt = null;
ResultSet rs = null;
SortrowBean valueObject = null;
Collection<SortrowBean> col = Collections.synchronizedList(new ArrayList<SortrowBean>());
try{
pStmt = con.prepareStatement(FIND_ALL_STATEMENT);
rs = pStmt.executeQuery();
while (rs.next()){
valueObject = populate(rs);
valueObject.afterPopulate(con);
col.add(valueObject);
}
return col;
}finally{
if(null!=rs){
View Full Code Here

* @throws SQLException
*/
public static Object findByPrimaryKey(Connection con, PrimaryKey key) throws SQLException {
PreparedStatement pStmt = null;
ResultSet rs = null;
SortrowBean valueObject = null;
SortrowKey primaryKey = (SortrowKey) key;
try{
pStmt = con.prepareStatement(SortrowBeanBase.SELECT_STATEMENT);
pStmt.setObject(1, primaryKey.getUserid());
pStmt.setObject(2, primaryKey.getListname());
pStmt.setObject(3, primaryKey.getRowvalue());
rs = pStmt.executeQuery();
while (rs.next()){
valueObject = populate(rs);
valueObject.afterPopulate(con);
}
return valueObject;
}finally{
if(null!=rs){
rs.close();
View Full Code Here

 
  @Test
  public void testCentrenameList(){
    try {
      SortrowBean centrenameList = (SortrowBean)SortrowFinderBase.findByPrimaryKey(new SortrowKey("System", "centrenameList", "CENTRENAME"));
      assertNotNull("Missing sortrow centrenameList", centrenameList);
     
    } catch (SQLException e) {
      fail("Database exception"+ e.getMessage());
    }
View Full Code Here

TOP

Related Classes of org.openqreg.bean.SortrowBean

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.