public Adresses getAdressbyId(long adresses_id) {
try {
String hql = "select c from Adresses as c where c.adresses_id = :adresses_id";
Object idf = PersistenceSessionUtil.createSession();
EntityManager session = PersistenceSessionUtil.getSession();
EntityTransaction tx = session.getTransaction();
tx.begin();
Query query = session.createQuery(hql);
query.setParameter("adresses_id", new Long(adresses_id));
Adresses addr = null;
try {
addr = (Adresses) query.getSingleResult();
} catch (NoResultException ex) {
}
tx.commit();
PersistenceSessionUtil.closeSession(idf);
return addr;
} catch (Exception ex2) {
log.error("getAdressbyId",ex2);
}