Package org.openqreg.bean

Examples of org.openqreg.bean.GuisettingBean


* @return A populated GuisettingBean
*
* @throws SQLException
*/
protected static GuisettingBean populate(ResultSet rs) throws SQLException {
GuisettingBean valueObject = new GuisettingBean();
valueObject.setId((Long)rs.getObject(1));
valueObject.setUserid((String)rs.getObject(2));
valueObject.setGuiid((String)rs.getObject(3));
valueObject.setGuikey((String)rs.getObject(4));
valueObject.setGuivalue((String)rs.getObject(5));
valueObject.setTscreated((java.sql.Timestamp)rs.getObject(6));
valueObject.setCreatedby((String)rs.getObject(7));
return valueObject;
}
View Full Code Here


* @throws SQLException
*/
public static Collection<GuisettingBean> findAll(Connection con) throws SQLException {
PreparedStatement pStmt = null;
ResultSet rs = null;
GuisettingBean valueObject = null;
Collection<GuisettingBean> col = Collections.synchronizedList(new ArrayList<GuisettingBean>());
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;
GuisettingBean valueObject = null;
GuisettingKey primaryKey = (GuisettingKey) key;
try{
pStmt = con.prepareStatement(GuisettingBeanBase.SELECT_STATEMENT);
pStmt.setObject(1, primaryKey.getId());
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 (GuisettingBean gsb : col) {
          gsb.remove(con);
        }
        TreeMap<String, String> outer = guiSettings.get(guiId);
        for (String key : outer.keySet()) {
          GuisettingBean gsb = new GuisettingBean();
          gsb.setUserid(userId);
          gsb.setCreatedby(userId);
          gsb.setGuiid(guiId);
          gsb.setGuikey(key);
          gsb.setGuivalue(outer.get(key));
          gsb.create(con);
        }
      }
      con.commit();
    } catch (SQLException sqle) {
      try {
View Full Code Here

        && null != awr.getGuiIds().iterator().next()) {
      // first guiid is primary.
      guiId = awr.getGuiIds().iterator().next();
    }

    GuisettingBean gsb = getFilter(userId, guiId);
    jsonString = awr.getJson();

    if (StringUtils.isNotEmpty(jsonString)
        && Dispatcher.getInstance().checkAccess(userId,
            "GUISETTING_STORE")) {
      // we have json in request
      // set in jsonString
      // store it in settings (newsWidget/newsFilter)
      if (null == gsb) {
        gsb = new GuisettingBean();
        gsb.setUserid(userId);
        gsb.setCreatedby(userId);
        // gsb.setGuiid("guestbookWidget");

        gsb.setGuiid(guiId);
        gsb.setGuikey("filter");
        // gsb.setGuivalue(outer.get(key));
        gsb.create();
      } else {
        gsb.setGuivalue(awr.getJson());
        gsb.store();
      }
    } else if (null != gsb) {
      // get from db (if it is there)
      jsonString = gsb.getGuivalue();
    }

    if (null != jsonString && !"".equals(jsonString)
        && !"null".equals(jsonString)) {
      // we have json, read filters (later used in sql)
View Full Code Here

      throws SQLException {
    // String guiId = "guestbookWidget";
    String guiKey = "filter";
    Collection<GuisettingBean> col = GuisettingFinder
        .findByUseridGuiidGuikey(userId, guiId, guiKey);
    GuisettingBean gsb = null;
    for (GuisettingBean gsbTemp : col) {
      gsb = gsbTemp;
    }

    return gsb;
View Full Code Here

        for (GuisettingBean gsb : col) {
          gsb.remove(con);
        }
        TreeMap<String, String> outer = guiSettings.get(guiId);
        for (String key : outer.keySet()) {
          GuisettingBean gsb = new GuisettingBean();
          gsb.setUserid(userId);
          gsb.setCreatedby(userId);
          gsb.setGuiid(guiId);
          gsb.setGuikey(key);
          gsb.setGuivalue(outer.get(key));
          gsb.create(con);
        }
      }
      con.commit();
    } catch (SQLException sqle) {
      try {
View Full Code Here

TOP

Related Classes of org.openqreg.bean.GuisettingBean

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.