*/
public States getStateById(long state_id) {
try {
Object idf = PersistenceSessionUtil.createSession();
EntityManager session = PersistenceSessionUtil.getSession();
EntityTransaction tx = session.getTransaction();
tx.begin();
Query query = session
.createQuery("select c from States as c where c.state_id = :state_id AND c.deleted <> :deleted");
query.setParameter("state_id", state_id);
query.setParameter("deleted", "true");
List ll = query.getResultList();
tx.commit();
PersistenceSessionUtil.closeSession(idf);
if (ll.size() > 0) {
return (States) ll.get(0);
}
} catch (Exception ex2) {