List of usage examples for org.hibernate CacheMode GET
CacheMode GET
To view the source code for org.hibernate CacheMode GET.
Click Source Link
From source file:com.sap.data.db.dao.BapiFUPARAREFDao.java
public BapiFUPARAREFPojo selectParameter(String funcName, String parameter) throws NotFoundException { BapiFUPARAREFPojo pojo = null;/*from w w w.j av a 2s . com*/ Session session = null; try { session = HibernateUtil.getSession(); session.setCacheMode(CacheMode.GET); pojo = (BapiFUPARAREFPojo) session.createCriteria("BapiFUPARAREFPojo") .add(Restrictions.eq("id.FUNCNAME", funcName)).add(Restrictions.eq("id.PARAMETER", parameter)) .addOrder(Order.asc("id.FUNCNAME")).addOrder(Order.asc("id.R3STATE")) .addOrder(Order.asc("id.PARAMETER")).addOrder(Order.asc("id.PARAMTYPE")) .addOrder(Order.asc("PPOSITION")).setMaxResults(1).uniqueResult(); } catch (HibernateException ex) { Logger.getLogger(BapiFUPARAREFDao.class.getName()).log(Level.SEVERE, null, ex); throw new NotFoundException(ex.getMessage()); } finally { HibernateUtil.close(session); } return pojo; }
From source file:com.sap.data.db.dao.BapiFUPARAREFDao.java
public List<BapiFUPARAREFPojo> selectParameters(String funcName, String paramType) throws NotFoundException { List<BapiFUPARAREFPojo> list = null; Session session = null;//from w w w .j a v a 2s.co m try { session = HibernateUtil.getSession(); session.setCacheMode(CacheMode.GET); list = session.createCriteria("BapiFUPARAREFPojo").add(Restrictions.eq("id.FUNCNAME", funcName)) .add(Restrictions.eq("id.PARAMTYPE", paramType)).addOrder(Order.asc("id.FUNCNAME")) .addOrder(Order.asc("id.R3STATE")).addOrder(Order.asc("id.PARAMETER")) .addOrder(Order.asc("id.PARAMTYPE")).addOrder(Order.asc("PPOSITION")).list(); } catch (HibernateException ex) { Logger.getLogger(BapiFUPARAREFDao.class.getName()).log(Level.SEVERE, null, ex); throw new NotFoundException(ex.getMessage()); } finally { HibernateUtil.close(session); } return list; }
From source file:com.sap.data.db.dao.EventDao.java
public List<EventPojo> select() throws NotFoundException { List<EventPojo> list = null; Session session = null;//from w w w.j a v a 2 s .co m try { session = HibernateUtil.getSession(); session.setCacheMode(CacheMode.GET); list = session.createCriteria("EventPojo").add(Restrictions.eq("DELETIONFLAG", "1")) .addOrder(Order.desc("EVENT_ID")).list(); } catch (HibernateException ex) { Logger.getLogger(EventDao.class.getName()).log(Level.SEVERE, null, ex); throw new NotFoundException(ex.getMessage()); } finally { HibernateUtil.close(session); } return list; }
From source file:com.sap.data.db.dao.EventDao.java
private EventPojo selectMaxEvent() throws NotFoundException { List<EventPojo> list = null; Session session = null;/*w w w .j a va 2 s . c om*/ try { session = HibernateUtil.getSession(); session.setCacheMode(CacheMode.GET); list = session.createCriteria("EventPojo").addOrder(Order.desc("EVENT_ID")).list(); } catch (HibernateException ex) { Logger.getLogger(EventDao.class.getName()).log(Level.SEVERE, null, ex); throw new NotFoundException(ex.getMessage()); } finally { HibernateUtil.close(session); } if (list != null && !list.isEmpty()) { return list.get(0); } else { return null; } }
From source file:com.sap.data.db.dao.EventDao.java
public String selectFuncName(String eventNumber) throws NotFoundException { List<EventPojo> list = null; Session session = null;//w w w . j av a2 s .co m try { session = HibernateUtil.getSession(); session.setCacheMode(CacheMode.GET); list = session.createCriteria("EventPojo").add(Restrictions.eq("EVENT_NUMBER", eventNumber)) .addOrder(Order.asc("EVENT_ID")).list(); } catch (HibernateException ex) { Logger.getLogger(EventDao.class.getName()).log(Level.SEVERE, null, ex); throw new NotFoundException(ex.getMessage()); } finally { HibernateUtil.close(session); } return list != null && !list.isEmpty() ? list.get(0).getFUNCNAME() : ""; }
From source file:com.sap.data.db.dao.EventDao.java
public List<EventPojo> selectEvents(String eventNumber) throws NotFoundException { List<EventPojo> evnts = null; Session session = null;//from w w w . j a v a 2 s . c om try { session = HibernateUtil.getSession(); session.setCacheMode(CacheMode.GET); evnts = session.createCriteria("EventPojo").add(Restrictions.eq("EVENT_NUMBER", eventNumber)) .addOrder(Order.asc("EVENT_ID")).list(); } catch (HibernateException ex) { Logger.getLogger(EventDao.class.getName()).log(Level.SEVERE, null, ex); throw new NotFoundException(ex.getMessage()); } finally { HibernateUtil.close(session); } return evnts; }
From source file:com.sap.data.db.dao.EventDao.java
public String selectEventNumber(String jCoFunction) throws NotFoundException { List<EventPojo> list = null; Session session = null;//from ww w . j a va2 s . c om try { session = HibernateUtil.getSession(); session.setCacheMode(CacheMode.GET); list = session.createCriteria("EventPojo").add(Restrictions.eq("FUNCNAME", jCoFunction)).list(); } catch (HibernateException ex) { Logger.getLogger(EventDao.class.getName()).log(Level.SEVERE, null, ex); throw new NotFoundException(ex.getMessage()); } finally { HibernateUtil.close(session); } if (list != null && !list.isEmpty()) { return list.get(0).getEVENT_NUMBER(); } else { return null; } }
From source file:com.sap.data.db.dao.StructureDao.java
public List<?> selectE0015() throws NotFoundException { List<?> list = null;//from www.j av a2 s . c om Session session = null; try { session = HibernateUtil.getSession(); session.setCacheMode(CacheMode.GET); list = session.createCriteria(this.structure).list(); } catch (HibernateException ex) { Logger.getLogger(StructureDao.class.getName()).log(Level.SEVERE, null, ex); throw new NotFoundException(ex.getMessage()); } finally { HibernateUtil.close(session); } return list; }
From source file:com.sap.data.db.dao.StructureDao.java
public List<?> selectE0015(int firstResult, int maxResults) throws NotFoundException { List<?> list = null;/*from ww w . j av a2 s . co m*/ Session session = null; try { session = HibernateUtil.getSession(); session.setCacheMode(CacheMode.GET); list = session.createCriteria(this.structure).setFirstResult(firstResult).setMaxResults(maxResults) .list(); } catch (HibernateException ex) { Logger.getLogger(StructureDao.class.getName()).log(Level.SEVERE, null, ex); throw new NotFoundException(ex.getMessage()); } finally { HibernateUtil.close(session); } return list; }
From source file:com.sap.data.db.dao.StructureDao.java
public List<?> selectByJCO_USER(String jCo_USer, int firstResult, int maxResults) throws NotFoundException { List<?> list = null;/* w w w . ja va 2s . c o m*/ Session session = null; try { session = HibernateUtil.getSession(); session.setCacheMode(CacheMode.GET); list = session.createCriteria(this.structure).add(Restrictions.eq("DId.JCO_USER", jCo_USer)) .setFirstResult(firstResult).setMaxResults(maxResults).list(); } catch (HibernateException ex) { Logger.getLogger(StructureDao.class.getName()).log(Level.SEVERE, null, ex); throw new NotFoundException(ex.getMessage()); } finally { HibernateUtil.close(session); } return list; }