* @throws SQLException
*/
public static Object findByPrimaryKey(Connection con, PrimaryKey key) throws SQLException {
PreparedStatement pStmt = null;
ResultSet rs = null;
CentreattributeBean valueObject = null;
CentreattributeKey primaryKey = (CentreattributeKey) key;
try{
pStmt = con.prepareStatement(CentreattributeBeanBase.SELECT_STATEMENT);
pStmt.setObject(1, primaryKey.getId());
pStmt.setObject(2, primaryKey.getAttributename());
rs = pStmt.executeQuery();
while (rs.next()){
valueObject = populate(rs);
valueObject.afterPopulate(con);
}
return valueObject;
}finally{
if(null!=rs){
rs.close();