Examples of dataSearch()


Examples of hibernateLogic.DatabaseTools.dataSearch()

                    // Now check that the question is correctly stored in the database
                    boolean questionFound = myTools.dataSearch("Question", "id", newQuestionID);

                    // Now check that the answers are correctly stored in the database
                    boolean trueAnswerFound = myTools.dataSearch("Answer", "id", trueAnswerId);

                    boolean falseAnswerFound = myTools.dataSearch("Answer", "id", falseAnswerId);

                    // Now check, if not all the database checks are true, return false status
                    if(!(questionFound && trueAnswerFound && falseAnswerFound)){
View Full Code Here

Examples of hibernateLogic.DatabaseTools.dataSearch()

                    boolean questionFound = myTools.dataSearch("Question", "id", newQuestionID);

                    // Now check that the answers are correctly stored in the database
                    boolean trueAnswerFound = myTools.dataSearch("Answer", "id", trueAnswerId);

                    boolean falseAnswerFound = myTools.dataSearch("Answer", "id", falseAnswerId);

                    // Now check, if not all the database checks are true, return false status
                    if(!(questionFound && trueAnswerFound && falseAnswerFound)){
                      return new QuestionStatusJson(false);
                    }
View Full Code Here

Examples of hibernateLogic.DatabaseTools.dataSearch()

      {
        // Set up your Database Tools
        DatabaseTools myTools = new DatabaseTools();
       
        // Start by confirming / finding the user
        boolean userFound = myTools.dataSearch("User", "id", userId, "password", password);
       
        if (!userFound) {
          throw new Exception ("User not found");
        }
       
View Full Code Here

Examples of hibernateLogic.DatabaseTools.dataSearch()

        }
       
        else
        {
          // next confirm the group exists
          boolean groupFound = myTools.dataSearch("Group", "id", groupId);
         
          if (!groupFound)
          {  // if group is not found, throw an exception
            throw new Exception ("Group not found");
          }
View Full Code Here

Examples of hibernateLogic.DatabaseTools.dataSearch()

         
          //group exists
          else
          {
            // Confirm that question with this id exists
            boolean questionFound = myTools.dataSearch("Question", "id", questionId);
           
            if(!questionFound)
            {  // if question is not found, throw an exception
              throw new Exception ("Question not found!");
            }
View Full Code Here

Examples of hibernateLogic.DatabaseTools.dataSearch()

                 Question theQuestion = (Question)objTool.getObject(Table.Question, "id", questionId);
                 // Delete the question
              myQuestionTools.dataRemoval(theQuestion);
             
              // Now check that the question is correctly stored in the database
                questionFound = myTools.dataSearch("Question", "id", questionId);
                // get the answers list again, to check if they were deleted; list size 0 = deleted
              answersList = myAnswerTools.getTypeList(Table.Answer, Column.questionId, questionId);
             
              if(questionFound || answersList.size() > 0)
              {
View Full Code Here

Examples of hibernateLogic.DatabaseTools.dataSearch()

      {
        // set up database tool
        DatabaseTools myTools = new DatabaseTools();
       
        //first confirm the group with this id exists
        boolean groupFound = myTools.dataSearch("Group", "id", groupId);
       
        if (!groupFound)
        {
          throw new Exception("Failed to find a group with this id" );
        }
View Full Code Here

Examples of hibernateLogic.DatabaseTools.dataSearch()

      else {
       
        //set up db tools
        DatabaseTools myTools = new DatabaseTools();
       
        boolean userFound = myTools.dataSearch("User", "id", userId, "password", password);
       
        //verify user exists
        if (!userFound){
          throw new Exception("User not found");
        }
View Full Code Here

Examples of hibernateLogic.DatabaseTools.dataSearch()

      else {
       
        //set up db tools
        DatabaseTools myTools = new DatabaseTools();
       
        boolean userFound = myTools.dataSearch("User", "id", userId, "password", password);
       
        //verify user exists
        if (!userFound){
          throw new Exception("User not found");
        }
View Full Code Here

Examples of hibernateLogic.DatabaseTools.dataSearch()

            throw new Exception("User does not belong to this group");
          }
         
          else {
           
            boolean invitedUserExists = myTools.dataSearch("User", "email", invitedEmail);
           
            if (!invitedUserExists) {
              throw new Exception("Invited email is not currently an existing user");
            }
           
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.