Package pl.edu.pb.entities

Examples of pl.edu.pb.entities.AppUser


    }
   
    protected AppUser createUser(String login, String firstname, String secondname,
            String passwrod, String mail, String telephone, String status)
    {
        AppUser result = new AppUser();
        result.setContact(new UserContact());
        result.setLogin(login);
        result.setPassword(passwrod);
        result.setStatus(status);
        result.getContact().setEmail(mail);
        result.getContact().setFirstName(firstname);
        result.getContact().setSecondName(secondname);
        return result;
    }
View Full Code Here


    private AppUser currentUser;

    public void login() throws Exception {

        AppUser user = auf.findUser(credentials.getUsername(), credentials.getPassword());

        if (user != null) {

            this.currentUser = user;
View Full Code Here

        String username = req.getParameter("username");
        String password = req.getParameter("password");
        //logger
        System.out.println("adding " + username + ":" + password);
       
        AppUser newUser = new AppUser();
        UserContact userContact = new UserContact();
        if(username != null && password != null && !username.equals("") &&
                !password.equals(""))
        {
            if(userManagment.isUserExist(username))
            {
                req.setAttribute("message", "That user exist already in out db");
            } else
            {
                userContact.setFirstName(req.getParameter("firstname"));
                userContact.setEmail(req.getParameter("email"));
                userContact.setPhoneNumber(req.getParameter("phonenumber"));
                userContact.setSecondName(req.getParameter("secondname"));
                newUser.setLogin(username);
                newUser.setPassword(password);
                newUser.setStatus(req.getParameter("status"));
                newUser.setContact(userContact);
                userManagment.addUser(newUser);
                req.setAttribute("message", "User was added, thank you for cooperation!");
            }
        }
        else
View Full Code Here

    public AppUserFacade() {
        super(AppUser.class);
    }
   
    public AppUser findUser(String username, String password){
        AppUser result = (AppUser) em

                  .createQuery(
                        "select u from AppUser u where u.contact.firstName=:username and u.contact.password=:password")
                  .setParameter("username", username)
                  .setParameter("password", password).getSingleResult();
View Full Code Here

                  .setParameter("password", password).getSingleResult();
        return result;
    }
   
    public AppUser findExistingUser(String username){
        AppUser result = null;
        try {
        result = (AppUser) em
                  .createQuery(
                        "select u from AppUser u where u.login=:username")
                  .setParameter("username", username).getSingleResult();
View Full Code Here

TOP

Related Classes of pl.edu.pb.entities.AppUser

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.