42 lines
1.1 KiB
Plaintext
Executable File
42 lines
1.1 KiB
Plaintext
Executable File
package com.fp.armas.portal.dao.registro;
|
|
|
|
import java.util.List;
|
|
|
|
import javax.persistence.Query;
|
|
|
|
import com.fp.armas.portal.dao.general.GenericDaoImpl;
|
|
import com.fp.armas.portal.model.Tsafeuser;
|
|
import com.fp.armas.portal.model.Tsafeuserdetail;
|
|
import com.fp.armas.portal.util.FechaUtil;
|
|
import com.fp.armas.portal.util.RegistroException;
|
|
|
|
/**
|
|
* Objeto de acceso a datos de la tabla {@link Tsafeuser}
|
|
* @author dcruz
|
|
*
|
|
*/
|
|
public class UsuarioDao extends GenericDaoImpl<Tsafeuser> {
|
|
|
|
public UsuarioDao() {
|
|
super(Tsafeuser.class);
|
|
}
|
|
|
|
/**
|
|
* Busca y retorna todos los usuarios encontrados
|
|
* @param personcode
|
|
* @return
|
|
* @throws RegistroException
|
|
*/
|
|
@SuppressWarnings("unchecked")
|
|
public List<Tsafeuser> buscaUsers(String usercode) throws RegistroException{
|
|
Query query = this.getEntityManager().createQuery("SELECT o FROM Tsafeuser o WHERE o.usercode=:usercode");
|
|
query.setParameter("usercode", usercode);
|
|
List<Tsafeuser> listUser = query.getResultList();
|
|
if(listUser != null && !listUser.isEmpty()){
|
|
return listUser;
|
|
}
|
|
return null;
|
|
}
|
|
|
|
}
|