Package org.pathways.openciss.model

Examples of org.pathways.openciss.model.User


public class UserService {
  public static EntityManager em;
 
  public static User getUser(int user_key) {
    User result = null;
    em =EMF.get().createEntityManager();
    try {
      result = em.find(User.class, user_key);
    }
    finally {em.close();}
View Full Code Here


    finally {em.close();}
    return result;
  }
 
  public static User getUser(String username) {
    User result = null;
    em =EMF.get().createEntityManager();
    try {
      //result = em.find(User.class, username);
      //String queryStr = "SELECT DISTINCT u FROM User AS u WHERE (u.username = " + username + ")";
      CriteriaBuilder cb = em.getCriteriaBuilder();
View Full Code Here

  public boolean updateUser(User u, String userID) {
    boolean result = false;
    em =EMF.get().createEntityManager();
    try{
       em.getTransaction().begin();
       User ux = em.find(User.class, Integer.valueOf(userID));
       ux.setNameFirst(u.getNameFirst());
       ux.setNameLast(u.getNameLast());
       ux.setInactive(u.getInactive());

       em.getTransaction().commit();
       result = true;
     }
    catch (Exception e){System.out.println("couldn't persist: " + e);
View Full Code Here

        System.out.print("submitted username is: " + username);
        System.out.println(", submitted password is: " + upToken.getPassword().toString());
        checkNotNull(username, "Null usernames are not allowed by this realm.");
        String password = null;
        //try {
          User user =  UserService.getUser(username);
          password = user.getPasswordEnc();
          System.out.println("retrieved password is: " + password);
          //password = Safe.getPassword(username);
        //} catch (Exception e) {System.out.println(e);}
        return new SimpleAuthenticationInfo(username, password.toCharArray(), getName());
      //new SimpleAuthenticationInfo(username, "blue".toCharArray(), getName());
View Full Code Here

TOP

Related Classes of org.pathways.openciss.model.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.