Package org.openqreg.bean

Examples of org.openqreg.bean.ListboxtextrowBean


* @return A populated ListboxtextrowBean
*
* @throws SQLException
*/
protected static ListboxtextrowBean populate(ResultSet rs) throws SQLException {
ListboxtextrowBean valueObject = new ListboxtextrowBean();
valueObject.setId((String)rs.getObject(1));
valueObject.setListorder((Integer)rs.getObject(2));
valueObject.setDocument((String)rs.getObject(3));
valueObject.setTextid((String)rs.getObject(4));
valueObject.setTextvalue((String)rs.getObject(5));
valueObject.setSelected((Integer)rs.getObject(6));
valueObject.setTscreated((java.sql.Timestamp)rs.getObject(7));
valueObject.setTsupdated((java.sql.Timestamp)rs.getObject(8));
valueObject.setCreatedby((String)rs.getObject(9));
valueObject.setUpdatedby((String)rs.getObject(10));
valueObject.setValidfrom((java.sql.Date)rs.getObject(11));
valueObject.setValidto((java.sql.Date)rs.getObject(12));
return valueObject;
}
View Full Code Here


* @throws SQLException
*/
public static Collection<ListboxtextrowBean> findAll(Connection con) throws SQLException {
PreparedStatement pStmt = null;
ResultSet rs = null;
ListboxtextrowBean valueObject = null;
Collection<ListboxtextrowBean> col = Collections.synchronizedList(new ArrayList<ListboxtextrowBean>());
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;
ListboxtextrowBean valueObject = null;
ListboxtextrowKey primaryKey = (ListboxtextrowKey) key;
try{
pStmt = con.prepareStatement(ListboxtextrowBeanBase.SELECT_STATEMENT);
pStmt.setObject(1, primaryKey.getId());
pStmt.setObject(2, primaryKey.getListorder());
pStmt.setObject(3, primaryKey.getDocument());
rs = pStmt.executeQuery();
while (rs.next()){
valueObject = populate(rs);
valueObject.afterPopulate(con);
}
return valueObject;
}finally{
if(null!=rs){
rs.close();
View Full Code Here

//    for (ListboxtextrowBean t : col) {
//      t.remove(con);
//    }
    // int orderNo = 0;
    // List<Node> textList = elementNode.selectNodes("text/label");
    ListboxtextrowBean lb;
    Timestamp ts = new Timestamp(Calendar.getInstance().getTimeInMillis());
    Node selected = null;
    Node interval = null;
    // for (Node n : textList) {

    lb = new ListboxtextrowBean();
    lb.setId(id + "_L");
    // lb.setId(id);
    lb.setListorder(Integer.valueOf(orderNr));
    // saveText(con, id + "_"+orderNr + "_L", elementNode
    // .selectSingleNode("text"));

    // saveText(con, id + "_L_" + orderNr, elementNode
    // .selectSingleNode("text"));
    lb.setTextid(id + "_L_" + orderNr + "_D");
    saveText(con, id + "_L_" + orderNr,
        elementNode.selectSingleNode("text"));

    // lb.setLanguageid(n.valueOf("@lang"));

    // lb.setText(n.getText());
    lb.setTextvalue(elementNode.selectSingleNode("value").getText());
    // Selected
    selected = elementNode.selectSingleNode("selected");
    if (selected != null && selected.getText().equalsIgnoreCase("true")) {
      lb.setSelected(Integer.valueOf(1));
    } else {
      lb.setSelected(Integer.valueOf(0));
    }
    interval = elementNode.selectSingleNode("intervals/interval");
    // Validfrom
    lb.setValidfrom(Converter.stringToSqlDate(interval.valueOf("@start")));
    // Validto
    if (interval.valueOf("@stop") != null
        && !interval.valueOf("@stop").equals("")) {
      lb.setValidto(Converter.stringToSqlDate(interval.valueOf("@stop")));
    }

    lb.setTscreated(ts);
    lb.setCreatedby(SYSTEM);
    lb.setTsupdated(ts);
    lb.setUpdatedby(SYSTEM);
    // Remove first to avoid duplicate
    // lb.remove(con);
    // Create
    lb.setDocument(getDocumentName());
    lb.create(con);
    // orderNo++;
    // }
  }
View Full Code Here

TOP

Related Classes of org.openqreg.bean.ListboxtextrowBean

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.