Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package th.in.oneauthen.object.DAO;
- import java.util.List;
- import org.apache.log4j.Logger;
- import th.athichitsakul.dao.impl.StandardDAOImpl;
- import th.in.oneauthen.object.DocumentDB;
- import th.in.oneauthen.object.UserUidDB;
- import th.in.oneauthen.util.SystemLogger;
- public class DocumentDAO extends StandardDAOImpl<DocumentDB>{
- private Logger logger = SystemLogger.generateSystemLogger(DocumentDAO.class);
- public DocumentDAO() {
- super("esigning");
- }
- public List<DocumentDB> findByUserUID ( UserUidDB userUID ) {
- List<DocumentDB> history = null;
- try {
- // UserUidDB user = new UserUidDAO().find(userUID);;
- // if ( user == null ) {
- // logger.error("User not found with ID "+userUID);
- // } else {
- DAO.begin();
- history = (List<DocumentDB>) DAO.getEntityManager().createNamedQuery("gethistoryByOwner")
- .setParameter("creator", userUID)
- .getResultList();
- // }
- } catch (Exception e) {
- logger.error("Invalid user loading with ID "+userUID , e);
- } finally {
- DAO.close();
- }
- return history;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement