Examples of dataEntry()


Examples of hibernateLogic.DatabaseTools.dataEntry()

        return UserFactory.id(0); //ID of zero means failed to find
      }
      else{
        // Not found? Create the new user and add them to the database
        User newUser = UserFactory.createUser(firstName,lastName,email,password);
        int myID = myTools.dataEntry(newUser);
       
        // search the database to confirm
        boolean userFound = myTools.dataSearch("User", "email", newUser.getEmail());
         
        // Respond to let them know it was successful (like login API)
View Full Code Here

Examples of hibernateLogic.DatabaseTools.dataEntry()

        else
        {
          // create a topic instance from the GroupFactory
          Group newGroup = GroupFactory.createGroup(groupName, groupDescription);
            // apply data entry on the group instance
          int newGroupID = myTools.dataEntry(newGroup);
         
          // Creating the relational database entry - This is how the user and group are linked
          UserRoleGroup newRelationship = new UserRoleGroup(userId, newGroupID, 1, newGroup.getCreateDate());
          // Adding the relationship to the database
          int newUserRoleGroup = myTools.dataEntry(newRelationship);
View Full Code Here

Examples of hibernateLogic.DatabaseTools.dataEntry()

          int newGroupID = myTools.dataEntry(newGroup);
         
          // Creating the relational database entry - This is how the user and group are linked
          UserRoleGroup newRelationship = new UserRoleGroup(userId, newGroupID, 1, newGroup.getCreateDate());
          // Adding the relationship to the database
          int newUserRoleGroup = myTools.dataEntry(newRelationship);
           
          //Confirm Group exist by searching its id
          // WILL NEED TO ADD LOGIC IN THE FUTURE TO CLEAN THINGS UP IF ONLY ONE IS ADDED AND NOT THE OTHER
          boolean groupConfirmed = myTools.dataSearch("Group", "id", newGroupID);
          boolean relationshipConfirmed = myTools.dataSearch("UserRoleGroup", "id", newUserRoleGroup);
View Full Code Here

Examples of hibernateLogic.DatabaseTools.dataEntry()

             
              //create question using factory
              Question questionObj = QuestionFactory.createQuestionMC(userId, groupId, question);
             
              //add question to the database
              int newQuestionID = myTools.dataEntry(questionObj);
       
              //set up answers
              Answer correct= QuestionFactory.createAnswer(correctAnswer, 1, newQuestionID, true);
              Answer wrong1 = QuestionFactory.createAnswer(answer2,     2, newQuestionID, false);
              Answer wrong2 = QuestionFactory.createAnswer(answer3,     3, newQuestionID, false);
View Full Code Here

Examples of hibernateLogic.DatabaseTools.dataEntry()

              Answer wrong1 = QuestionFactory.createAnswer(answer2,     2, newQuestionID, false);
              Answer wrong2 = QuestionFactory.createAnswer(answer3,     3, newQuestionID, false);
              Answer wrong3 = QuestionFactory.createAnswer(answer4,     4, newQuestionID, false);

              // Now adding the answers to the database
              int correctAnswerId = myTools.dataEntry(correct);

              int answer2Id = myTools.dataEntry(wrong1);

              int answer3Id = myTools.dataEntry(wrong2);
View Full Code Here

Examples of hibernateLogic.DatabaseTools.dataEntry()

              Answer wrong3 = QuestionFactory.createAnswer(answer4,     4, newQuestionID, false);

              // Now adding the answers to the database
              int correctAnswerId = myTools.dataEntry(correct);

              int answer2Id = myTools.dataEntry(wrong1);

              int answer3Id = myTools.dataEntry(wrong2);

              int answer4Id = myTools.dataEntry(wrong3);
View Full Code Here

Examples of hibernateLogic.DatabaseTools.dataEntry()

              // Now adding the answers to the database
              int correctAnswerId = myTools.dataEntry(correct);

              int answer2Id = myTools.dataEntry(wrong1);

              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);
View Full Code Here

Examples of hibernateLogic.DatabaseTools.dataEntry()

              int answer2Id = myTools.dataEntry(wrong1);

              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
View Full Code Here

Examples of hibernateLogic.DatabaseTools.dataEntry()

            else {
             
               Question questionObj = QuestionFactory.createQuestionTF(userId, groupId, question);
                   
                    //add question to the database
                    int newQuestionID = myTools.dataEntry(questionObj);

                    // The logic to decide whether the correct answer is "True" or "False"
                    Answer trueAnswer, falseAnswer;
                   
                  // If the answer is true then "True" is true. If false, then "True" is false.
View Full Code Here

Examples of hibernateLogic.DatabaseTools.dataEntry()

                  // If the answer is true then "True" is true. If false, then "True" is false.
                  trueAnswer = QuestionFactory.createAnswer("True", 1, newQuestionID, answer);
                    falseAnswer = QuestionFactory.createAnswer("False", 2, newQuestionID, !answer);
               
                    // 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);
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.