Package org.openqreg.bean

Examples of org.openqreg.bean.GrouprelationBean


    out.append("</td>");
    out.append("<td class=\"listLinkCellTopic\">");
    out.append(lang.getTranslation(langId,"ADMINGROUPRELATION_TSCREATED_HL"));
    out.append("</td>");
    out.append("</tr>");
    GrouprelationBean grouprelationBean=null;
    if (col != null) {
      for (Iterator<GrouprelationBean> it = col.iterator(); it.hasNext();)  {
        grouprelationBean=it.next();
        addRow(out);
        out.append("<td><input type=\"checkbox\" name=\"GROUPRELATION_")
        .append(grouprelationBean.getRelatestoid()+"\"")
        .append(" id=\"GROUPRELATION_")
        .append(grouprelationBean.getRelatestoid()+"\"")
        .append(" value=\"1\"");
        if(grouprelationBean.getStatus().intValue()==1){
          out.append(" checked=\"true\"");
        }
        out.append(" onClick=\"saveCheck();\"></td>\n");
        addColumn(out, grouprelationBean.getRelatestoid());
        addColumn(out, grouprelationBean.getCreatedby());
        if(null!=grouprelationBean.getTscreated()) {
          addColumn(out, grouprelationBean.getTscreated().toString().substring(0,16));
        } else {
          addColumn(out,"&nbsp;");
        }
        out.append("</tr>");
      }
View Full Code Here


            groupRelations.remove(sBean.getRelatestoid());
          }
        }
        // loop remaining groupRelations and create them
        for (String ugId : groupRelations) {
          GrouprelationBean sBean = new GrouprelationBean();
          sBean.setCreatedby(userId);
          sBean.setUsergroupid(userGroupBean.getId());
          sBean.setRelatestoid(ugId);
          sBean.setStatus(Integer.valueOf(1));
          sBean.setTscreated(new Timestamp(System.currentTimeMillis()));
          sBean.create(con);
        }
        con.commit();
//        sa.setStatus(AjaxWidgetAnswer.STATUS_UPDATED);
        Dispatcher.getInstance().populateAccessTable();
        // Collection<FileBean> col =
View Full Code Here

      // Current old services for service = serviceid
      Collection<GrouprelationBean> oldGrouprelCol=
        GrouprelationFinder.findByUsergroupidSpecial(groupid);
     
      Iterator<GrouprelationBean> itOld = oldGrouprelCol.iterator();
      GrouprelationBean oldRelBean=null;
      // Step
      while(null!=itOld && itOld.hasNext()) {
        oldRelBean=itOld.next();
       
        if(oldRelBean.getStatus().intValue()==1) {
          // Group was enabled in relation before
          if(null==tr.get("GROUPRELATION_"+oldRelBean.getRelatestoid())) {
            // only exist in old -> delete
            oldRelBean.remove();
          }
        } else {
          // Group relation was disabled before
          if(null!=tr.get("GROUPRELATION_"+oldRelBean.getRelatestoid())) {
            // create new
            oldRelBean.setUsergroupid(groupid);
            oldRelBean.setRelatestoid(oldRelBean.getRelatestoid());
            oldRelBean.setStatus(new Integer(1));
            oldRelBean.setTscreated(new Timestamp(time));
            oldRelBean.setCreatedby(user.getId());
            oldRelBean.setTsupdated(new Timestamp(time));
            oldRelBean.setUpdatedby(user.getId());
            oldRelBean.create();
          }
        }
       
      }
      fetch.removeValue("changed");
View Full Code Here

* @return A populated GrouprelationBean
*
* @throws SQLException
*/
protected static GrouprelationBean populate(ResultSet rs) throws SQLException {
GrouprelationBean valueObject = new GrouprelationBean();
valueObject.setUsergroupid((String)rs.getObject(1));
valueObject.setRelatestoid((String)rs.getObject(2));
valueObject.setStatus((Integer)rs.getObject(3));
valueObject.setTscreated((java.sql.Timestamp)rs.getObject(4));
valueObject.setTsupdated((java.sql.Timestamp)rs.getObject(5));
valueObject.setCreatedby((String)rs.getObject(6));
valueObject.setUpdatedby((String)rs.getObject(7));
return valueObject;
}
View Full Code Here

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

TOP

Related Classes of org.openqreg.bean.GrouprelationBean

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.