Package org.openqreg.bean

Examples of org.openqreg.bean.VarintervalBean


* @return A populated VarintervalBean
*
* @throws SQLException
*/
protected static VarintervalBean populate(ResultSet rs) throws SQLException {
VarintervalBean valueObject = new VarintervalBean();
valueObject.setAutoid((Long)rs.getObject(1));
valueObject.setId((String)rs.getObject(2));
valueObject.setValidfrom((java.sql.Date)rs.getObject(3));
valueObject.setValidto((java.sql.Date)rs.getObject(4));
valueObject.setOrdernumber((Integer)rs.getObject(5));
return valueObject;
}
View Full Code Here


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

    // elementId);
    // for (VarintervalBean intervalBean : col) {
    // intervalBean.remove(con);
    // }
    int orderNr = 0;
    VarintervalBean varIntervalBean = null;
    for (Node node : intervalList) {
      varIntervalBean = new VarintervalBean();
      varIntervalBean.setAutoid(autoId);
      varIntervalBean.setId(elementId);
      String start = node.valueOf("@start");
      if (start != null && !start.equals("")) {
        varIntervalBean.setValidfrom(Converter.stringToSqlDate(start));
      }
      String stop = node.valueOf("@stop");
      if (stop != null && !stop.equals("")) {
        varIntervalBean.setValidto(Converter.stringToSqlDate(stop));
      }

      varIntervalBean.setOrdernumber(new Integer(orderNr));
      varIntervalBean.create(con);
      orderNr++;
    }
  }
View Full Code Here

    elBase = new Container();
    elemParam = new DefaultElementParameter();
    intervals = new TreeMap<Integer, VarintervalBean>();
   
   
    viBean = new VarintervalBean();
    viBean.setValidto(Converter.stringToSqlDate("1990-12-31"));
   
    viBean2 = new VarintervalBean();
    viBean2.setValidfrom(Converter.stringToSqlDate("2000-01-01"));
    viBean2.setValidfrom(Converter.stringToSqlDate("2010-12-31"));
   
    viBean3 = new VarintervalBean();
    viBean3.setValidfrom(Converter.stringToSqlDate("2015-01-01"));
   
  }
View Full Code Here

TOP

Related Classes of org.openqreg.bean.VarintervalBean

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.