Package hibernateLogic

Examples of hibernateLogic.DatabaseTools.dataSearch()


      else {
        // 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


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

              int answer3Id = myTools.dataEntry(wrong2);

              int answer4Id = myTools.dataEntry(wrong3);

              // 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 correctAnswerFound = myTools.dataSearch("Answer", "id", correctAnswerId);

              boolean answer2Found = myTools.dataSearch("Answer", "id", answer2Id);
View Full Code Here

              // 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 correctAnswerFound = myTools.dataSearch("Answer", "id", correctAnswerId);

              boolean answer2Found = myTools.dataSearch("Answer", "id", answer2Id);

              boolean answer3Found = myTools.dataSearch("Answer", "id", answer3Id);
View Full Code Here

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

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

              boolean answer2Found = myTools.dataSearch("Answer", "id", answer2Id);

              boolean answer3Found = myTools.dataSearch("Answer", "id", answer3Id);

              boolean answer4Found = myTools.dataSearch("Answer", "id", answer4Id);
            
View Full Code Here

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

              boolean answer2Found = myTools.dataSearch("Answer", "id", answer2Id);

              boolean answer3Found = myTools.dataSearch("Answer", "id", answer3Id);

              boolean answer4Found = myTools.dataSearch("Answer", "id", answer4Id);
            
              // Now check, if not all the database checks are true, return false status
              if(!(questionFound && correctAnswerFound && answer2Found && answer3Found && answer4Found)) {
View Full Code Here

              boolean answer2Found = myTools.dataSearch("Answer", "id", answer2Id);

              boolean answer3Found = myTools.dataSearch("Answer", "id", answer3Id);

              boolean answer4Found = myTools.dataSearch("Answer", "id", answer4Id);
            
              // Now check, if not all the database checks are true, return false status
              if(!(questionFound && correctAnswerFound && answer2Found && answer3Found && answer4Found)) {

                return new QuestionStatusJson(false);
View Full Code Here

      else {
        // 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

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

                    // Now adding the answers to the database
                    int trueAnswerId = myTools.dataEntry(trueAnswer);
                    int falseAnswerId = myTools.dataEntry(falseAnswer);

                    // 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);
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.