Examples of dataSearch()


Examples of hibernateLogic.DatabaseTools.dataSearch()

      {
        // Set up your database Tools
        DatabaseTools myTools = new DatabaseTools();
       
        // Make sure the email is not already registered
        boolean userExists = myTools.dataSearch("User", "email", email);

      // Return false if a user is found!
      if(userExists){
        return UserFactory.id(0); //ID of zero means failed to find
      }
View Full Code Here

Examples of hibernateLogic.DatabaseTools.dataSearch()

        // 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)
        if(userFound){
          return UserFactory.id(myID); //return ID
        }
View Full Code Here

Examples of hibernateLogic.DatabaseTools.dataSearch()

     
      // Set up your database Tools
    DatabaseTools myTools = new DatabaseTools();
     
    // Confirm user exists (and correct password)
      boolean userFound = myTools.dataSearch("User", "email", email, "password", password);
   
    // If not found return false response
    if(!userFound){
      return UserFactory.validUser(false);
    }
View Full Code Here

Examples of hibernateLogic.DatabaseTools.dataSearch()

     
      // Remove user from table
    myTools.dataRemoval(deleteUser);
   
    // If user is not found return true! That means successful deletion.
    return UserFactory.validUser(!myTools.dataSearch("User", "email", email, "password", password));
    }
   
 
    @RequestMapping(value = "user/login", method=RequestMethod.GET)
  public @ResponseBody UserIDJson login( // ResponseEntity<StatusOutput>
View Full Code Here

Examples of hibernateLogic.DatabaseTools.dataSearch()

      {
        // Set up your database Tools
        DatabaseTools myTools = new DatabaseTools();
       
        // See if the user exists and if the password is correct
        boolean userFound = myTools.dataSearch("User", "email", email, "password", password);
       
        // If found create StatusOutput=TRUE and return
        if(userFound){
          ObjectRetrievalTools<User> myUser = new ObjectRetrievalTools<User>();
          User test = myUser.getObject(Table.User, "email", email);
View Full Code Here

Examples of hibernateLogic.DatabaseTools.dataSearch()

      {
        // Set up your database Tools
        DatabaseTools myTools = new DatabaseTools();
       
        // See if the user exists and if the password is correct
        boolean userFound = myTools.dataSearch("User", "email", email, "password", password);
       
        // If found create StatusOutput=TRUE and return
        if(userFound){
          User myUser = myTools.getUser(email, password);
          if(firstName != null){ myUser.setFirstName(firstName);}
View Full Code Here

Examples of hibernateLogic.DatabaseTools.dataSearch()

      else {
        // set up database tool set here
        DatabaseTools myTools = new DatabaseTools();
       
        //first confirm id and password are correct
        boolean userFound = myTools.dataSearch("User", "id", userId, "password", password);
       
        if (!userFound) {
          throw new Exception("Failed to find user" );
        }
        else
View Full Code Here

Examples of hibernateLogic.DatabaseTools.dataSearch()

          throw new Exception("Failed to find user" );
        }
        else
        {
          //check to see if any UserRoleGroup contain userId
          boolean groupFound = myTools.dataSearch("UserRoleGroup", "userId", userId);
         
          // if there are no groups then return an empty array
          if (!groupFound){
            return new GroupDetailsJson[0];
          }
View Full Code Here

Examples of hibernateLogic.DatabaseTools.dataSearch()

      {
        // Set up your database Tools
        DatabaseTools myTools = new DatabaseTools();
       
        // Confirm user exists and has the correct password before letting them pass.
          boolean userFound = myTools.dataSearch("User", "id", userId, "password", password);

        // Return false if a user is not found or password incorrect!
      if(!userFound)
      {
        return GroupFactory.validGroup(false);
View Full Code Here

Examples of hibernateLogic.DatabaseTools.dataSearch()

      }
      else // If user verified
      {
        // See if the group already exists
         
        boolean groupFound = myTools.dataSearch("Group", "groupTitle", groupName);

        if(groupFound)
        {
          return GroupFactory.validGroup(false);
        }
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.