Package com.zosatapo.commons.store

Examples of com.zosatapo.commons.store.jResultSet


    {
      return;
    }
    super.start();

    jResultSet jrs = null;
    String strSQL = null;
    try
    {

      //---------------------------------------------create user group relation
      strSQL =
        "SELECT vc_userid,vc_groupid FROM "
          + getSchemaContext().getTableName(SchemaContext.SCHEMA_USER_GROUP);

      jrs = jStatement.executeQuery(getStore(), strSQL);
      int sizeUserGroup = jrs.getRowCount();
      for (int i = 1; i <= sizeUserGroup; ++i)
      {
        jrs.absolute(i);
        String groupid = jrs.getString("vc_groupid");
        String userid = jrs.getString("vc_userid");
        WorkflowGroup workflowGroup = findGroup(groupid);
        WorkflowParticipant workflowUser = findParticipant(userid);
        workflowGroup.addPaticipant(workflowUser);
      }
      jrs.release();

      //---------------------------------------------create user department relation
      strSQL =
        "SELECT vc_userid,vc_departmenetid FROM "
          + getSchemaContext().getTableName(SchemaContext.SCHEMA_USER_DEPARTMENT);

      jrs = jStatement.executeQuery(getStore(), strSQL);
      int sizeUserDept = jrs.getRowCount();
      for (int i = 1; i <= sizeUserDept; ++i)
      {
        jrs.absolute(i);
        String deptid = jrs.getString("vc_departmenetid");
        String userid = jrs.getString("vc_userid");
        WorkflowDepartment workflowDept = findDepartment(deptid);
        WorkflowParticipant workflowUser = findParticipant(userid);
        workflowDept.addPaticipant(workflowUser);
      }
      jrs.release();

      //---------------------------------------------create user role relation
      strSQL =
        "SELECT vc_userid,vc_roleid FROM "
          + getSchemaContext().getTableName(SchemaContext.SCHEMA_USER_ROLE);

      jrs = jStatement.executeQuery(getStore(), strSQL);
      int sizeUserRole = jrs.getRowCount();
      for (int i = 1; i <= sizeUserRole; ++i)
      {
        jrs.absolute(i);
        String roleid = jrs.getString("vc_roleid");
        String userid = jrs.getString("vc_userid");
        WorkflowRole workflowRole = findRole(roleid);
        WorkflowParticipant workflowUser = findParticipant(userid);
        workflowRole.addPaticipant(workflowUser);
      }
      jrs.release();

    }
    catch (SQLException sqlex)
    {
      throw new WorkflowException(sqlex);
View Full Code Here


    String strSQL =
      "SELECT  vc_uuid,vc_name,vc_description "
        + " FROM "
        + getSchemaContext().getTableName(SchemaContext.SCHEMA_RANK);

    jResultSet jrs = null;

    try
    {
      jrs = jStatement.executeQuery(getStore(), strSQL);

      int sizeRank = jrs.getRowCount();
      for (int i = 1; i <= sizeRank; ++i)
      {
        jrs.absolute(i);
        ranks.put(
          jrs.getString("vc_uuid"),
          new WorkflowRankImpl(
            jrs.getString("vc_uuid"),
            jrs.getString("vc_name"),
            jrs.getString("vc_description")));
      }
      jrs.release();
    }
    catch (SQLException ex)
    {
      ;
    }
View Full Code Here

    String strSQL =
      "SELECT  vc_uuid,vc_name,vc_description "
        + " FROM "
        + getSchemaContext().getTableName(SchemaContext.SCHEMA_CATEGORY);

    jResultSet jrs = null;

    try
    {
      jrs = jStatement.executeQuery(getStore(), strSQL);

      int sizeCategory = jrs.getRowCount();
      for (int i = 1; i <= sizeCategory; ++i)
      {
        jrs.absolute(i);
        categories.put(
          jrs.getString("vc_uuid"),
          new WorkflowCategoryImpl(
            jrs.getString("vc_uuid"),
            jrs.getString("vc_name"),
            jrs.getString("vc_description")));
      }
      jrs.release();
    }
    catch (SQLException sqlex)
    {
      ;
    }
View Full Code Here

      "SELECT vc_uuid,vc_name,vc_password,vc_fullname,vc_description,vc_rankid "
        + " "
        + " FROM "
        + getSchemaContext().getTableName(SchemaContext.SCHEMA_USER);

    jResultSet jrs = null;

    try
    {
      jrs = jStatement.executeQuery(getStore(), strSQL);

      int sizeUser = jrs.getRowCount();
      WorkflowParticipant participant = null;
      for (int i = 1; i <= sizeUser; ++i)
      {
        jrs.absolute(i);
        participant =
          createParticipant_impl(
            jrs.getString("vc_uuid"),
            jrs.getString("vc_name"),
            jrs.getString("vc_password"),
            jrs.getString("vc_fullname"),
            jrs.getString("vc_description"));

        participant.setRank(findRank(jrs.getString("vc_rankid")));
        participants.put(jrs.getString("vc_uuid"), participant);
      }

      jrs.release();
    }
    catch (SQLException sqlex)
    {
      ;
    }

    strSQL =
      "SELECT vc_userid,vc_packageId "
        + " "
        + " FROM "
        + getSchemaContext().getTableName(SchemaContext.SCHEMA_ADMIN);

    try
    {
      jrs = jStatement.executeQuery(getStore(), strSQL);

      int sizeAdmin = jrs.getRowCount();
      for (int i = 1; i <= sizeAdmin; ++i)
      {
        jrs.absolute(i);
        WorkflowParticipantImpl_RT participantImpl =
          (WorkflowParticipantImpl_RT) this.findParticipant(jrs.getString("vc_userid"));

        if ("all".equalsIgnoreCase(jrs.getString("vc_packageId")))
        {
          participantImpl.setSuperAdministrator(true);
        }
        else
        {
          participantImpl.addPackage(jrs.getString("vc_packageId"));
        }
      }

      jrs.release();
    }
    catch (SQLException sqlex)
    {
      ;
    }
View Full Code Here

    String strSQL =
      "SELECT  vc_uuid,vc_name,vc_description "
        + " FROM "
        + getSchemaContext().getTableName(SchemaContext.SCHEMA_ROLE);

    jResultSet jrs = null;

    try
    {
      jrs = jStatement.executeQuery(getStore(), strSQL);

      int sizeRole = jrs.getRowCount();
      for (int i = 1; i <= sizeRole; ++i)
      {
        jrs.absolute(i);
        roles.put(
          jrs.getString("vc_uuid"),
          createRole(
            jrs.getString("vc_uuid"),
            jrs.getString("vc_name"),
            jrs.getString("vc_description")));
      }
      jrs.release();
    }
    catch (SQLException sqlex)
    {
      ;
    }
View Full Code Here

    {
      strSQL += " WHERE vc_parent IS NULL";

      try
      {
        jResultSet jrs = jStatement.executeQuery(getStore(), strSQL);

        int sizeGroup = jrs.getRowCount();
        for (int i = 1; i <= sizeGroup; ++i)
        {
          jrs.absolute(i);
          WorkflowDepartment workflowDepartment =
            createDepartment(
              jrs.getString("vc_uuid"),
              jrs.getString("vc_name"),
              jrs.getString("vc_description"),
              parentDept);
          workflowDepartment.setCategory(findCategory(jrs.getString("vc_categoryid")));
          workflowDepartment.setPresident(findParticipant(jrs.getString("vc_presidentid")));
          departments.put(jrs.getString("vc_uuid"), workflowDepartment);
          genDepartmentTree(departments, workflowDepartment);
        }

        jrs.release();
      }
      catch (SQLException sqlex)
      {
        ;
      }
View Full Code Here

    if (parentGroup == null)
    {
      try
      {
        strSQL += " WHERE vc_parent IS NULL";
        jResultSet jrs = jStatement.executeQuery(getStore(), strSQL);

        int sizeGroup = jrs.getRowCount();
        for (int i = 1; i <= sizeGroup; ++i)
        {
          jrs.absolute(i);
          WorkflowGroup workflowGroup =
          createGroup_impl(
              jrs.getString("vc_uuid"),
              jrs.getString("vc_name"),
              jrs.getString("vc_description"),
              parentGroup);
          workflowGroup.setDepartment(this.findDepartment(jrs.getString("vc_departmentid")))
          workflowGroup.setPresident(this.findParticipant(jrs.getString("vc_presidentid")));   
          groups.put(jrs.getString("vc_uuid"), workflowGroup);
          genGroupTree(groups, workflowGroup);

        }
        jrs.release();
      }
      catch (SQLException sqlex)
      {
        ;
      }
View Full Code Here

    {
       return;
    }
    super.start();
   
    jResultSet jrs = null;
    String strSQL = null;
    try
    {
      //---------------------------------------------create rank
      strSQL =
        "SELECT  vc_uuid,vc_name,vc_description "
          + " FROM "
          + getSchemaContext().getTableName(SchemaContext.SCHEMA_RANK);

      jrs = jStatement.executeQuery(getStore(), strSQL);

      int sizeRank = jrs.getRowCount();
      for (int i = 1; i <= sizeRank; ++i)
      {
        jrs.absolute(i);
        ranks.put(
          jrs.getString("vc_uuid"),
          new WorkflowRankImpl(
            jrs.getString("vc_uuid"),
            jrs.getString("vc_name"),
            jrs.getString("vc_description")));
      }
      jrs.release();

      //---------------------------------------------create category
      strSQL =
        "SELECT  vc_uuid,vc_name,vc_description "
          + " FROM "
          + getSchemaContext().getTableName(SchemaContext.SCHEMA_CATEGORY);

      jrs = jStatement.executeQuery(getStore(), strSQL);

      int sizeCategory = jrs.getRowCount();
      for (int i = 1; i <= sizeCategory; ++i)
      {
        jrs.absolute(i);
        categories.put(
          jrs.getString("vc_uuid"),
          new WorkflowCategoryImpl(
            jrs.getString("vc_uuid"),
            jrs.getString("vc_name"),
            jrs.getString("vc_description")));
      }
      jrs.release();

      //---------------------------------------------create role
      strSQL =
        "SELECT  vc_uuid,vc_name,vc_description "
          + " FROM "
          + getSchemaContext().getTableName(SchemaContext.SCHEMA_ROLE);

      jrs = jStatement.executeQuery(getStore(), strSQL);

      int sizeRole = jrs.getRowCount();
      for (int i = 1; i <= sizeRole; ++i)
      {
        jrs.absolute(i);
        createRole(
            jrs.getString("vc_uuid"),
            jrs.getString("vc_name"),
            jrs.getString("vc_description"));
      }
      jrs.release();
     
      //---------------------------------------------create users
      strSQL =
        "SELECT vc_uuid,vc_name,vc_password,vc_fullname,vc_description,vc_rankid "
          + " "
          + " FROM "
          + getSchemaContext().getTableName(SchemaContext.SCHEMA_USER);

      jrs = jStatement.executeQuery(getStore(), strSQL);

      int sizeUser = jrs.getRowCount();
      WorkflowParticipant participant = null;
      for (int i = 1; i <= sizeUser; ++i)
      {
        jrs.absolute(i);
        participant =
          createParticipant(
            jrs.getString("vc_uuid"),
            jrs.getString("vc_name"),
            jrs.getString("vc_password"),
            jrs.getString("vc_fullname"),
            jrs.getString("vc_description"));

        participant.setRank((WorkflowRank) ranks.get(jrs.getString("vc_rankid")));
      }

      jrs.release();

      //---------------------------------------------set user administrator
      strSQL =
        "SELECT vc_userid,vc_packageId "
          + " "
          + " FROM "+ getSchemaContext().getTableName(SchemaContext.SCHEMA_ADMIN);

      jrs = jStatement.executeQuery(getStore(), strSQL);

      int sizeAdmin = jrs.getRowCount();
      for (int i = 1; i <= sizeAdmin; ++i)
      {
        jrs.absolute(i);
        WorkflowParticipantImpl participantImpl=(WorkflowParticipantImpl)this.findParticipant(jrs.getString("vc_userid"));     
       
        if("all".equalsIgnoreCase(jrs.getString("vc_packageId")))
        {
          participantImpl.setSuperAdministrator(true);
        }
        else
        {
          participantImpl.addPackage(jrs.getString("vc_packageId"));
        }
      }

      jrs.release();
     
      //---------------------------------------------create departments
      genDepartmentTree(null);     

      //---------------------------------------------create groups
      genGroupTree(null);
     
      //---------------------------------------------create user group relation
      strSQL =
        "SELECT vc_userid,vc_groupid FROM "
          + getSchemaContext().getTableName(SchemaContext.SCHEMA_USER_GROUP);

      jrs = jStatement.executeQuery(getStore(), strSQL);
      int sizeUserGroup = jrs.getRowCount();
      for (int i = 1; i <= sizeUserGroup; ++i)
      {
        jrs.absolute(i);
        String groupid = jrs.getString("vc_groupid");
        String userid = jrs.getString("vc_userid");
        WorkflowGroup workflowGroup = findGroup(groupid);
        WorkflowParticipant workflowUser = findParticipant(userid);
        workflowGroup.addPaticipant(workflowUser);
      }
      jrs.release();

      //---------------------------------------------create user department relation
      strSQL =
        "SELECT vc_userid,vc_departmenetid FROM "
          + getSchemaContext().getTableName(SchemaContext.SCHEMA_USER_DEPARTMENT);

      jrs = jStatement.executeQuery(getStore(), strSQL);
      int sizeUserDept = jrs.getRowCount();
      for (int i = 1; i <= sizeUserDept; ++i)
      {
        jrs.absolute(i);
        String deptid = jrs.getString("vc_departmenetid");
        String userid = jrs.getString("vc_userid");
        WorkflowDepartment workflowDept = findDepartment(deptid);
        WorkflowParticipant workflowUser = findParticipant(userid);
        workflowDept.addPaticipant(workflowUser);
      }
      jrs.release();

      //---------------------------------------------create user role relation
      strSQL =
        "SELECT vc_userid,vc_roleid FROM "
          + getSchemaContext().getTableName(SchemaContext.SCHEMA_USER_ROLE);

      jrs = jStatement.executeQuery(getStore(), strSQL);
      int sizeUserRole = jrs.getRowCount();
      for (int i = 1; i <= sizeUserRole; ++i)
      {
        jrs.absolute(i);
        String roleid = jrs.getString("vc_roleid");
        String userid = jrs.getString("vc_userid");
        WorkflowRole workflowRole = findRole(roleid);
        WorkflowParticipant workflowUser = findParticipant(userid);
        workflowRole.addPaticipant(workflowUser);
      }
      jrs.release();
     
    }
    catch (SQLException sqlex)
    {
      throw new WorkflowException(sqlex);
View Full Code Here

        + getSchemaContext().getTableName(SchemaContext.SCHEMA_DEPARTMENT);

    if (parentDept == null)
    {
      strSQL += " WHERE vc_parent IS NULL";
      jResultSet jrs = jStatement.executeQuery(getStore(), strSQL);

      int sizeGroup = jrs.getRowCount();
      for (int i = 1; i <= sizeGroup; ++i)
      {
        jrs.absolute(i);
        WorkflowDepartment workflowDepartment =
          createDepartment(
            jrs.getString("vc_uuid"),
            jrs.getString("vc_name"),
            jrs.getString("vc_description"),
            parentDept);
        workflowDepartment.setCategory((WorkflowCategory)categories.get(jrs.getString("vc_categoryid")));
        genDepartmentTree(workflowDepartment);
      }

      jrs.release();
    }
    else
    {
      Connection conn = null;
      PreparedStatement pstmt = null;
View Full Code Here

        + getSchemaContext().getTableName(SchemaContext.SCHEMA_GROUP);

    if (parentGroup == null)
    {
      strSQL += " WHERE vc_parent IS NULL";
      jResultSet jrs = jStatement.executeQuery(getStore(), strSQL);

      int sizeGroup = jrs.getRowCount();
      for (int i = 1; i <= sizeGroup; ++i)
      {
        jrs.absolute(i);
        WorkflowGroup workflowGroup =
          createGroup(
            jrs.getString("vc_uuid"),
            jrs.getString("vc_name"),
            jrs.getString("vc_description"),
            parentGroup);
        workflowGroup.setDepartment((WorkflowDepartment)departments.get(jrs.getString("vc_departmentid")));
        genGroupTree(workflowGroup);
      }

      jrs.release();
    }
    else
    {
      Connection conn = null;
      PreparedStatement pstmt = null;
View Full Code Here

TOP

Related Classes of com.zosatapo.commons.store.jResultSet

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.