Package tk.vovanok.webapplicationexample.entities

Examples of tk.vovanok.webapplicationexample.entities.User


    @Inject
    UserDaoInterface userDao;

   
    void save(){
        User newUser = new User();
        newUser.setCreated(new Date());
        newUser.setLogin(login);
        newUser.setPassword(password);
        userDao.save(newUser);
    }
View Full Code Here


    public User loadByUserName(String userName) {
        if(userName == null || userName.trim().equals("")) return null;
       
        Query q = getEntityManager().createQuery("select u from User u where u.login = :userName").setParameter("userName", userName);
       
        User u = null;
     
        try {
            u = (User) q.getSingleResult();
        } catch (NoResultException e) {
            //nop
View Full Code Here

    }
   
    @Override
    public User findById(Long id) {
       Session session = getEntityManager().unwrap(Session.class);
       User u =(User) session.get(User.class, id);
       return u;
    }
View Full Code Here

TOP

Related Classes of tk.vovanok.webapplicationexample.entities.User

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.