Package java.util

Examples of java.util.Collection


      if (search != null && search.getSearchCriteria().size() > 0)
      {
        String primaryKey = "";
        String primaryTable = "";

        Collection col = this.performSearch(userId,search);
        primaryKey = ((HashMap)this.getPrimaryTableForModule(search.getModuleID())).get("TablePrimaryKey").toString();
        primaryTable = ((HashMap)this.getPrimaryTableForModule(search.getModuleID())).get("TableName").toString();
        // For some standard reports we had to hardcode the alias for the primary table.
        if(alias == null || alias.equals(""))
        {
          alias = primaryTable;
        }
        if (col.size() > 0)
        {
          where.append(" AND ");
          where.append(primaryTable + "." + primaryKey);
          where.append(" in (");
          boolean first = true;
          for (Iterator it = col.iterator(); it.hasNext(); ) {
            if (first) {
              first = false;
            }
            else {
View Full Code Here


    try
    {
      String sqlQuery = "SELECT SearchID FROM simplesearch WHERE ModuleID = ?";
      cvdal.setSqlQuery(sqlQuery);
      cvdal.setInt(1, moduleID);
      Collection resultsCollection = cvdal.executeQuery();
      if (resultsCollection != null)
      {
        Iterator resultsIterator = resultsCollection.iterator();
        if (resultsIterator.hasNext())
        {
          HashMap resultsHashMap = (HashMap) resultsIterator.next();
          int searchId = ((Number) resultsHashMap.get("SearchID")).intValue();
          searchID = new Integer(searchId);
View Full Code Here

      cvdl = new CVDal(dataSource);

      String str = "select mailFrom from emailmessage where MessageID in "+ allMailId + ";";
      cvdl.setSqlQueryToNull();
      cvdl.setSqlQuery(str);
      Collection col = cvdl.executeQuery();
      cvdl.clearParameters();

      Iterator iterator = col.iterator();
      while(iterator.hasNext())
      {
        HashMap emailsFrom = (HashMap)iterator.next();
        String signature = (String)emailsFrom.get("mailFrom");
        result.add(signature);
View Full Code Here

     //"select from emailstore where EmailFolder = ? and Messageid = ? ;");
        cvdl.setSql("email.selectemailstore");
          cvdl.setInt( 1, trashfolderid);
        cvdl.setInt( 2, mailId);

      Collection col = cvdl.executeQuery();
        cvdl.clearParameters();

      Iterator it = col.iterator();

      if (!(it.hasNext()))
      {
       cvdl.setSql("email.deleteattachment");
       cvdl.setInt( 1, mailId);
View Full Code Here

      CVDal cvdl = new CVDal(dataSource);

      cvdl.setSql( "projecttimeslip.gettimeSlip" );
      cvdl.setInt( 1 , timeSlipId );
       Collection col = cvdl.executeQuery();
      Iterator ite = col.iterator();
      if (ite.hasNext())
      {
        HashMap hm = (HashMap)ite.next();
        tvo.setTimeSlipID(((Long)hm.get("timeslipid")).intValue());
          if(hm.get("projectid")!=null)
          tvo.setProjectID(((Long)hm.get("projectid")).intValue());
        //tvo.setProjectTitle((String)hm.get("projecttitle"));
        //tvo.setTaskTitle((String)hm.get("title"));
        if(hm.get("activityid")!=null)
          tvo.setTaskID(((Integer)hm.get("activityid")).intValue());
        if(hm.get("ticketid")!=null){
          tvo.setTicketID(((Long)hm.get("ticketid")).intValue());
        }
        else{
          tvo.setTicketID(0);
        }
        tvo.setDescription((String)hm.get("description"));
        tvo.setDate((java.sql.Date)hm.get("date"));
        tvo.setStart((java.sql.Time)hm.get("start"));
        tvo.setEnd((java.sql.Time)hm.get("end"));
        tvo.setBreakTime(((Double)hm.get("breaktime")).floatValue());
        tvo.setHours(((Double)hm.get("hours")).floatValue());

      }
       cvdl.clearParameters();
      if (tvo.getProjectID() !=0 )
      {
        cvdl.setSql("projecttimeslip.getprojecttimeSlip");
        cvdl.setInt(1, tvo.getProjectID());
        col = cvdl.executeQuery();
        ite = col.iterator();
        if(ite.hasNext())
        {
          HashMap hm = (HashMap)ite.next();
          tvo.setProjectTitle((String)hm.get("projecttitle"));
        }
        cvdl.clearParameters();
      }

      if (tvo.getTaskID() !=0 )
      {
        cvdl.setSql("projecttimeslip.getactivitytimeSlip");
        cvdl.setInt(1, tvo.getTaskID());
        col = cvdl.executeQuery();
        ite = col.iterator();
        if(ite.hasNext())
        {
          HashMap hm = (HashMap)ite.next();
          tvo.setTaskTitle((String)hm.get("title"));
        }
        cvdl.clearParameters();
      }
      if (tvo.getTicketID() !=0 )
      {
        cvdl.setSqlQuery("select subject from ticket where ticketid ="+tvo.getTicketID());
        col = cvdl.executeQuery();
        ite = col.iterator();
        if(ite.hasNext())
        {
          HashMap hm = (HashMap)ite.next();
          tvo.setTicket((String)hm.get("subject"));
        }
View Full Code Here

      CVDal cvdl = new CVDal(dataSource);

      cvdl.setSql( "projecttimeslip.gettimeSlip" );
      cvdl.setInt( 1 , timeSlipId );
       Collection col = cvdl.executeQuery();
      Iterator ite = col.iterator();
      if (ite.hasNext())
      {
        HashMap hm = (HashMap)ite.next();
        tdbvo.setTimeSlipID(((Long)hm.get("timeslipid")).intValue());
          if(hm.get("projectid")!=null)
          tdbvo.setProjectID(((Long)hm.get("projectid")).intValue());
        //tvo.setProjectTitle((String)hm.get("projecttitle"));
        //tvo.setTaskTitle((String)hm.get("title"));
        if(hm.get("activityid")!=null)
          tdbvo.setTaskID(((Integer)hm.get("activityid")).intValue());
        if(hm.get("ticketid")!=null){
          tdbvo.setTicketID(((Long)hm.get("ticketid")).intValue());
        }
        else{
          tdbvo.setTicketID(0);
        }
        tdbvo.setDescription((String)hm.get("description"));
        tdbvo.setDate((java.sql.Date)hm.get("date"));
        tdbvo.setStart((java.sql.Time)hm.get("start"));
        tdbvo.setEnd((java.sql.Time)hm.get("end"));
        tdbvo.setBreakTime(((Double)hm.get("breaktime")).floatValue());
        tdbvo.setHours(((Double)hm.get("hours")).floatValue());

      }
       cvdl.clearParameters();
      if (tdbvo.getProjectID() !=0 )
      {
        cvdl.setSql("projecttimeslip.getprojecttimeSlip");
        cvdl.setInt(1, tdbvo.getProjectID());
        col = cvdl.executeQuery();
        ite = col.iterator();
        if(ite.hasNext())
        {
          HashMap hm = (HashMap)ite.next();
          tdbvo.setProjectTitle((String)hm.get("projecttitle"));
        }
        cvdl.clearParameters();
      }

      if (tdbvo.getTaskID() !=0 )
      {
        cvdl.setSql("projecttimeslip.getactivitytimeSlip");
        cvdl.setInt(1, tdbvo.getTaskID());
        col = cvdl.executeQuery();
        ite = col.iterator();
        if(ite.hasNext())
        {
          HashMap hm = (HashMap)ite.next();
          tdbvo.setTaskTitle((String)hm.get("title"));
        }
        cvdl.clearParameters();
      }
      if (tdbvo.getTicketID() !=0 )
      {
        cvdl.setSqlQuery("select subject from ticket where ticketid ="+tdbvo.getTicketID());
        col = cvdl.executeQuery();
        ite = col.iterator();
        if(ite.hasNext())
        {
          HashMap hm = (HashMap)ite.next();
          tdbvo.setTicket((String)hm.get("subject"));
        }
View Full Code Here

    }

    CVDal cvdl = new CVDal(dataSource);
    cvdl.setSql("project.getproject");
    cvdl.setInt(1, projectId);
    Collection col = cvdl.executeQuery();
    Iterator ite = col.iterator();
    ProjectDBVO pdbvo = new ProjectDBVO();
    if (ite.hasNext())
    {
      HashMap project = (HashMap)ite.next();
      pdbvo.setProjectID(((Long)project.get("ProjectID")).intValue());
      pdbvo.setTitle((String)project.get("ProjectTitle"));
      if (project.get("Description") != null)
        pdbvo.setDescription((String)project.get("Description"));
      if (project.get("StatusID") != null)
        pdbvo.setStatusID(((Long)project.get("StatusID")).intValue());
      if (project.get("Start") != null)
        pdbvo.setStart((java.sql.Date)project.get("Start"));
      if (project.get("End") != null)
        pdbvo.setEnd((java.sql.Date)project.get("End"));
      if (project.get("BudgetedHours") != null)
        pdbvo.setBudgetedHours(((Long)project.get("BudgetedHours")).intValue());
      if (project.get("HoursUsed") != null)
        pdbvo.setUsedHours(((Long)project.get("HoursUsed")).intValue());
      if (project.get("Manager") != null)
        pdbvo.setManagerID(((Long)project.get("Manager")).intValue());
      if (project.get("Owner") != null)
        pdbvo.setOwner(((Long)project.get("Owner")).intValue());
      if (project.get("Creator") != null)
        pdbvo.setCreator(((Long)project.get("Creator")).intValue());
      if (project.get("ModifiedBy") != null)
        pdbvo.setModifiedBy(((Long)project.get("ModifiedBy")).intValue());
      if (project.get("Modified") != null)
        pdbvo.setModified((Timestamp)project.get("Modified"));
      if (project.get("Created") != null)
        pdbvo.setCreated((Timestamp)project.get("Created"));
    }

    cvdl.clearParameters();
    cvdl.setSql("project.getindname");
    cvdl.setInt(1, pdbvo.getCreator());
    col = cvdl.executeQuery();
    ite = col.iterator();
    if (ite.hasNext())
    {
      HashMap hm = (HashMap)ite.next();
      pdbvo.setCreatorName((String)hm.get("CONCAT(firstname,' ',lastname)"));
    }

    cvdl.clearParameters();

    cvdl.setSql("project.getindname");
    cvdl.setInt(1, pdbvo.getModifiedBy());
    col = cvdl.executeQuery();
    ite = col.iterator();
    if (ite.hasNext())
    {
      HashMap hm = (HashMap)ite.next();
      pdbvo.setModifierName((String)hm.get("CONCAT(firstname,' ',lastname)"));
    }
    cvdl.clearParameters();

    cvdl.setSql("project.getprojectentitylink");
    cvdl.setInt(1, projectId);
    col = cvdl.executeQuery();
    ite = col.iterator();
    if (ite.hasNext())
    {
      HashMap hm = (HashMap)ite.next();
      pdbvo.setEntityID(((Long)hm.get("entityid")).intValue());
      pdbvo.setEntityName((String)hm.get("name"));
    }

    cvdl.clearParameters();

    cvdl.setSql("project.getprojectindividuallink");
    cvdl.setInt(1, projectId);
    col = cvdl.executeQuery();
    ite = col.iterator();
    if (ite.hasNext())
    {
      HashMap hm = (HashMap)ite.next();
      pdbvo.setContactID(((Long)hm.get("individualid")).intValue());
      pdbvo.setContactName((String)hm.get("CONCAT(firstname , ' ' , lastname)"));
    }

    cvdl.clearParameters();

    cvdl.setSql("project.getprojectgrouplink");
    cvdl.setInt(1, projectId);
    col = cvdl.executeQuery();
    ite = col.iterator();
    if (ite.hasNext())
    {
      HashMap hm = (HashMap)ite.next();
      pdbvo.setGroupID(((Long)hm.get("groupid")).intValue());
      pdbvo.setGroupName((String)hm.get("name"));
    }

    cvdl.clearParameters();

    cvdl.setSql("project.projecthoursused");
    cvdl.setInt(1, projectId);
    col = cvdl.executeQuery();
    ite = col.iterator();
    if (ite.hasNext())
    {
      HashMap hm = (HashMap)ite.next();
      if (hm.get("sum(hours)") != null)
      {
        pdbvo.setUsedHours(((Double)hm.get("sum(hours)")).floatValue());
      }
    }

    cvdl.clearParameters();

    cvdl.setSql("project.getindname");
    cvdl.setInt(1, pdbvo.getOwner());
    col = cvdl.executeQuery();
    ite = col.iterator();
    if (ite.hasNext())
    {
      HashMap hm = (HashMap)ite.next();
      pdbvo.setOwnerName((String)hm.get("CONCAT(firstname,' ',lastname)"));
    }
    cvdl.clearParameters();

    cvdl.setSql("project.getindname");
    cvdl.setInt(1, pdbvo.getManagerID());
    col = cvdl.executeQuery();
    ite = col.iterator();
    if (ite.hasNext())
    {
      HashMap hm = (HashMap)ite.next();
      pdbvo.setManager((String)hm.get("CONCAT(firstname,' ',lastname)"));
    }
View Full Code Here

    {

      CVDal cvdl = new CVDal(dataSource);
      cvdl.setSql( "projecttimeslip.selecttimeSlip" );
      cvdl.setInt( 1 , timeSlipId );
       Collection col = cvdl.executeQuery();
      Iterator ite = col.iterator();
      if (ite.hasNext())
      {
        HashMap hm = (HashMap)ite.next();

        cvdl.setSql("projecttimeslip.addtimeslip");
View Full Code Here

    }

    CVDal cvdl = new CVDal(dataSource);
    cvdl.setSql("project.getproject");
    cvdl.setInt(1, projectId);
    Collection col = cvdl.executeQuery();
    Iterator ite = col.iterator();
    ProjectVO pvo = new ProjectVO();
    if (ite.hasNext())
    {
      HashMap project = (HashMap)ite.next();
      pvo.setProjectID(((Long)project.get("ProjectID")).intValue());
      pvo.setTitle((String)project.get("ProjectTitle"));
      if (project.get("Description") != null)
        pvo.setDescription((String)project.get("Description"));
      if (project.get("StatusID") != null)
        pvo.setStatusID(((Long)project.get("StatusID")).intValue());
      if (project.get("Start") != null)
        pvo.setStart((java.sql.Date)project.get("Start"));
      if (project.get("End") != null)
        pvo.setEnd((java.sql.Date)project.get("End"));
      if (project.get("BudgetedHours") != null)
        pvo.setBudgetedHours(((Long)project.get("BudgetedHours")).intValue());
      if (project.get("HoursUsed") != null)
        pvo.setUsedHours(((Long)project.get("HoursUsed")).intValue());
      if (project.get("Owner") != null)
        pvo.setOwner(((Long)project.get("Owner")).intValue());
      if (project.get("Manager") != null)
        pvo.setManagerID(((Long)project.get("Manager")).intValue());
      if (project.get("Creator") != null)
        pvo.setCreator(((Long)project.get("Creator")).intValue());
      if (project.get("ModifiedBy") != null)
        pvo.setModifiedBy(((Long)project.get("ModifiedBy")).intValue());
      if (project.get("Modified") != null)
        pvo.setModified((Timestamp)project.get("Modified"));
      if (project.get("Created") != null)
        pvo.setCreated((Timestamp)project.get("Created"));
    }

    cvdl.clearParameters();
    cvdl.setSql("project.getindname");
    cvdl.setInt(1, pvo.getCreator());
    col = cvdl.executeQuery();
    ite = col.iterator();
    if (ite.hasNext())
    {
      HashMap hm = (HashMap)ite.next();
      pvo.setCreatorName((String)hm.get("CONCAT(firstname,' ',lastname)"));
    }

    cvdl.clearParameters();

    cvdl.setSql("project.getindname");
    cvdl.setInt(1, pvo.getModifiedBy());
    col = cvdl.executeQuery();
    ite = col.iterator();
    if (ite.hasNext())
    {
      HashMap hm = (HashMap)ite.next();
      pvo.setModifierName((String)hm.get("CONCAT(firstname,' ',lastname)"));
    }
    cvdl.clearParameters();

    cvdl.setSql("project.getprojectentitylink");
    cvdl.setInt(1, projectId);
    col = cvdl.executeQuery();
    ite = col.iterator();
    if (ite.hasNext())
    {
      HashMap hm = (HashMap)ite.next();
      pvo.setEntityID(((Long)hm.get("entityid")).intValue());
      pvo.setEntityName((String)hm.get("name"));
    }

    cvdl.clearParameters();

    cvdl.setSql("project.getprojectindividuallink");
    cvdl.setInt(1, projectId);
    col = cvdl.executeQuery();
    ite = col.iterator();
    if (ite.hasNext())
    {
      HashMap hm = (HashMap)ite.next();
      pvo.setContactID(((Long)hm.get("individualid")).intValue());
      pvo.setContactName((String)hm.get("CONCAT(firstname , ' ' , lastname)"));
    }

    cvdl.clearParameters();

    cvdl.setSql("project.getprojectgrouplink");
    cvdl.setInt(1, projectId);
    col = cvdl.executeQuery();
    ite = col.iterator();
    if (ite.hasNext())
    {
      HashMap hm = (HashMap)ite.next();
      pvo.setGroupID(((Long)hm.get("groupid")).intValue());
      pvo.setGroupName((String)hm.get("name"));
    }

    cvdl.clearParameters();

    cvdl.setSql("project.projecthoursused");
    cvdl.setInt(1, projectId);
    col = cvdl.executeQuery();
    ite = col.iterator();
    if (ite.hasNext())
    {
      HashMap hm = (HashMap)ite.next();
      if (hm.get("sum(hours)") != null)
      {
        pvo.setUsedHours(((Double)hm.get("sum(hours)")).floatValue());
      }
    }

    cvdl.clearParameters();

    cvdl.setSql("project.getindname");
    cvdl.setInt(1, pvo.getOwner());
    col = cvdl.executeQuery();
    ite = col.iterator();
    if (ite.hasNext())
    {
      HashMap hm = (HashMap)ite.next();
      pvo.setOwnerName((String)hm.get("CONCAT(firstname,' ',lastname)"));
    }
    cvdl.clearParameters();

    cvdl.setSql("project.getindname");
    cvdl.setInt(1, pvo.getManagerID());
    col = cvdl.executeQuery();
    ite = col.iterator();
    if (ite.hasNext())
    {
      HashMap hm = (HashMap)ite.next();
      pvo.setManager((String)hm.get("CONCAT(firstname,' ',lastname)"));
    }
View Full Code Here

      cvdal.setSqlQuery("SELECT * from garbagelist");
      list = cvdal.executeQueryList(1);
      cvdal.setSqlQueryToNull();

      cvdal.setSqlQuery("SELECT count(*) AS NoOfRecords FROM garbagelist");
      Collection colList = cvdal.executeQuery();
      cvdal.clearParameters();
      cvdal.setSqlQueryToNull();

    if (colList != null)
    {
     Iterator it = colList.iterator();
     if (it.hasNext())
     {
       HashMap hm = (HashMap)it.next();
       numberOfRecords = ((Number)hm.get("NoOfRecords")).intValue();
     }//end of if (it.hasNext())
View Full Code Here

TOP

Related Classes of java.util.Collection

Copyright © 2015 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.