Package hibernate

Examples of hibernate.Group


  }
 
  @Test
  public void test01() {
   
    Group group = new Group();
    group.setGroupTitle("hello");
    group.setGroupDesc("World");
    GroupInfoJson infoJson = GroupFactory.createGroupInfoJson(group);
   
    if (infoJson.getTitle().equals(group.getGroupTitle())){
     
    }
   
    else{
      Assert.fail("Failed because titles do not match");
    }
   
    if (infoJson.getDescription().equals(group.getGroupDesc())){
     
    }
   
    else{
      Assert.fail("Failed because desc do not match");
View Full Code Here


  }
 
  @Test
  public void test02(){
   
    Group groupTest = new Group();
    groupTest.setGroupTitle("hello");
    groupTest.setGroupDesc("world");
    int numberOfQuestions = 4;
    int numberOfMembers = 2;
   
    GroupDetailsJson groupDetails = GroupFactory.createGroupDetailsJson(groupTest, numberOfQuestions, numberOfMembers);
    //groupDetails.setCreateDate(groupTest.getCreateDate());
   
    if (groupDetails.getGroupTitle().equals(groupTest.getGroupTitle())){
     
    }
    else {
      Assert.fail("Failed because titles do not match");
    }
View Full Code Here

           
            //iterates the list of UserRoleGroups and extracts the Group based on the groupId of the UserRoleGroup
            //add the Group to the list storing Groups
            for (UserRoleGroup urgIterator : userUrgList)
            {
              Group group = (Group) objRetTools.getObject(Table.Group, "id", urgIterator.getGroupId());
              groups.add(group);
              //System.out.println("\n\n\tThis is a title: " + group.getGroupTitle());
            }
           
            //sets up return object
            GroupDetailsJson[] groupDetailsList = GroupFactory.createGroupDetailsJson(groups.size());
           
            //loops through each Group in the list
            for (int i = 0; i < groups.size(); i++)
            {
              Group groupObj = groups.get(i);
                //get a String representation of the groupId to search into the db
                String groupIdString = Integer.toString(groupObj.getId());
               
               
                //List<Question> questionList = objRetTools.getObjectList(Table.Question, "groupId", groupIdString);
                //int numOfQuestions = questionList.size();
// TO BE CHANGED TO THE REAL #
View Full Code Here

          return GroupFactory.validGroup(false);
        }
        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);
           
          //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
View Full Code Here

                 myTools.dataRemoval(urgDelete);
               }
              
               //lastly, retrieve the actual group for deletion
               ObjectRetrievalTools<Group> objTool5 = new ObjectRetrievalTools<Group>();
               Group remGroup = (Group) objTool5.getObject(Table.Group, "id", groupId);
              
               //call the tools to remove the group from the db
               myTools.dataRemoval(remGroup);
              
               //return true when group is deleted
View Full Code Here

          else {
           
            // pull group using the ObjectRetrievalTools class
            ObjectRetrievalTools<Group> retrieval = new ObjectRetrievalTools<Group>();
           
            Group group = retrieval.getObject(Table.Group, "id", groupId);
            // pass object to GroupFactory.createGroupInfoJson()
            GroupInfoJson infoJson = GroupFactory.createGroupInfoJson(group);
            return infoJson;
          }
        }               
View Full Code Here

           
            // pull group using the ObjectRetrievalTools class
            ObjectRetrievalTools<Group> retrieval = new ObjectRetrievalTools<Group>();
           
            //pull group object
            Group group = retrieval.getObject(Table.Group, "id", groupId);
           
            //call method in GroupFactory to update Group object
            group = GroupFactory.updateGroup(group, groupTitle, groupDesc);
           
            //send updated group back to db
View Full Code Here

   * @param title is the title or Primary Name of the group
   * @param description refers to more details about this group
   * @return is the return object
   */
  public static Group createGroup(String title, String description){
    Group group = new Group();
    Date date = new Date();
   
    group.setGroupTitle(title);
    group.setGroupDesc(description);
    group.setCreateDate(date);
   
    return group;
  }
View Full Code Here

  }
 
  public void testGroupCreate01() {
   
    // create a new group
    Group newGroup = GroupFactory.createGroup("Math", "Algebra study group");
   
    // Enter group into the database and get the ID back
    int myGroupID = myTools.dataEntry(newGroup);
   
    if(myGroupID <= 0) {Assert.fail(" Group ID was suppose to be > 0 but instead it was " + myGroupID);}
View Full Code Here

TOP

Related Classes of hibernate.Group

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.