37 lines
886 B
Java
37 lines
886 B
Java
package dao.entities.security;
|
|
|
|
import java.util.List;
|
|
import java.util.UUID;
|
|
|
|
import javax.persistence.NoResultException;
|
|
import javax.persistence.TypedQuery;
|
|
|
|
import dao.JpaDao;
|
|
import entities.security.UserInfo;
|
|
|
|
|
|
public class UserInfoDaoImpl extends JpaDao<UserInfo, UUID> implements UserInfoDao {
|
|
|
|
public UserInfo loadDetails(UserInfo t) {
|
|
// TODO Auto-generated method stub
|
|
return null;
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
public UserInfo getByKey(String id, String email) {
|
|
String queryString = "FROM UserInfo userInfo where userInfo.id = :userInfoID and userInfo.email = :userInfoEmail";
|
|
TypedQuery<UserInfo> typedQuery = entityManager.createQuery(queryString, UserInfo.class);
|
|
typedQuery.setParameter("userInfoID", id);
|
|
typedQuery.setParameter("userInfoEmail", email);
|
|
try {
|
|
return typedQuery.getSingleResult();
|
|
}
|
|
catch(NoResultException ex) {
|
|
return null;
|
|
}
|
|
}
|
|
|
|
|
|
} |