Created
March 15, 2017 15:30
-
-
Save HugoJBello/eeb5a5c31025eb34c4dc31ecada71940 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class UserDaoImpl implements UserDao { | |
@Override | |
public boolean isValidUser(String username, String password) { | |
boolean isValid = false; | |
EntityManager em = PersistenceManager.INSTANCE.getEntityManager(); | |
UserPK pkToFind = new UserPK(); | |
pkToFind.setUsername(username); | |
pkToFind.setPassword(password); | |
try { | |
User foundUser = em.find(User.class, pkToFind); | |
System.out.println("User "+ username + " found"); | |
isValid=true; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment