List of usage examples for org.hibernate.criterion CriteriaSpecification DISTINCT_ROOT_ENTITY
ResultTransformer DISTINCT_ROOT_ENTITY
To view the source code for org.hibernate.criterion CriteriaSpecification DISTINCT_ROOT_ENTITY.
Click Source Link
From source file:net.purnama.pureff.dao.PaymentTypeInDao.java
public List getPendingPaymentTypeInList(int type) { Session session = this.sessionFactory.getCurrentSession(); Criteria c = session.createCriteria(PaymentTypeInEntity.class); if (type < 4) { c.add(Restrictions.eq("type", type)); }// w ww . j av a2 s .c o m c.add(Restrictions.eq("valid", true)); c.add(Restrictions.eq("status", false)); c.setResultTransformer(CriteriaSpecification.DISTINCT_ROOT_ENTITY); return c.list(); }
From source file:net.purnama.pureff.dao.PaymentTypeInDao.java
public List<PaymentTypeInEntity> getPaymentTypeInList(Calendar start, Calendar end, WarehouseEntity warehouse, PartnerEntity partner, CurrencyEntity currency, int type, boolean valid, boolean status) { Session session = this.sessionFactory.getCurrentSession(); Criteria c = session.createCriteria(PaymentTypeInEntity.class, "paymenttypein"); c.createAlias("paymenttypein.paymentin", "paymentin"); c.add(Restrictions.between("paymentin.date", start, end)); if (warehouse != null) { c.add(Restrictions.eq("paymentin.warehouse", warehouse)); }/* w w w . jav a2s . c o m*/ if (currency != null) { c.add(Restrictions.eq("paymentin.currency", currency)); } if (partner != null) { c.add(Restrictions.eq("paymentin.partner", partner)); } if (type < 4) { c.add(Restrictions.eq("type", type)); } c.add(Restrictions.eq("paymenttypein.valid", valid)); c.add(Restrictions.eq("paymenttypein.status", status)); c.addOrder(Order.asc("paymentin.date")); c.setResultTransformer(CriteriaSpecification.DISTINCT_ROOT_ENTITY); return c.list(); }
From source file:net.purnama.pureff.dao.PaymentTypeInDao.java
public List<PaymentTypeInEntity> getPaymentTypeInList(Calendar start, Calendar end, WarehouseEntity warehouse, PartnerEntity partner, CurrencyEntity currency, boolean status) { Session session = this.sessionFactory.getCurrentSession(); Criteria c = session.createCriteria(PaymentTypeInEntity.class, "paymenttypein"); c.createAlias("paymenttypein.paymentin", "paymentin"); c.add(Restrictions.between("paymentin.date", start, end)); if (warehouse != null) { c.add(Restrictions.eq("paymentin.warehouse", warehouse)); }// w w w. j a v a 2 s . co m if (currency != null) { c.add(Restrictions.eq("paymentin.currency", currency)); } if (partner != null) { c.add(Restrictions.eq("paymentin.partner", partner)); } c.add(Restrictions.eq("paymentin.status", status)); c.addOrder(Order.asc("paymentin.date")); c.setResultTransformer(CriteriaSpecification.DISTINCT_ROOT_ENTITY); return c.list(); }
From source file:net.purnama.pureff.dao.PaymentTypeInDraftDao.java
public List getPaymentTypeInDraftList(PaymentInDraftEntity paymentindraft) { Session session = this.sessionFactory.getCurrentSession(); Criteria c = session.createCriteria(PaymentTypeInDraftEntity.class); c.add(Restrictions.eq("paymentindraft", paymentindraft)); c.addOrder(Order.asc("date")); c.setResultTransformer(CriteriaSpecification.DISTINCT_ROOT_ENTITY); return c.list(); }
From source file:net.purnama.pureff.dao.PaymentTypeOutDao.java
public List getPaymentTypeOutList(PaymentOutEntity paymentout) { Session session = this.sessionFactory.getCurrentSession(); Criteria c = session.createCriteria(PaymentTypeOutEntity.class); c.add(Restrictions.eq("paymentout", paymentout)); c.addOrder(Order.asc("date")); c.setResultTransformer(CriteriaSpecification.DISTINCT_ROOT_ENTITY); return c.list(); }
From source file:net.purnama.pureff.dao.PaymentTypeOutDao.java
public List getPaymentTypeOutList(int type, boolean accepted, boolean valid, Calendar begin, Calendar end) { Session session = this.sessionFactory.getCurrentSession(); Criteria c = session.createCriteria(PaymentTypeOutEntity.class); if (type < 4) { c.add(Restrictions.eq("type", type)); }/*from w w w . j a v a2s . c o m*/ c.add(Restrictions.eq("status", accepted)); c.add(Restrictions.eq("valid", valid)); c.add(Restrictions.between("duedate", begin, end)); c.addOrder(Order.asc("duedate")); c.setResultTransformer(CriteriaSpecification.DISTINCT_ROOT_ENTITY); return c.list(); }
From source file:net.purnama.pureff.dao.PaymentTypeOutDao.java
public List getPendingPaymentTypeOutList(int type) { Session session = this.sessionFactory.getCurrentSession(); Criteria c = session.createCriteria(PaymentTypeOutEntity.class); if (type < 4) { c.add(Restrictions.eq("type", type)); }// w w w .j a va 2 s .c o m c.add(Restrictions.eq("valid", true)); c.add(Restrictions.eq("status", false)); c.setResultTransformer(CriteriaSpecification.DISTINCT_ROOT_ENTITY); return c.list(); }
From source file:net.purnama.pureff.dao.PaymentTypeOutDao.java
public List<PaymentTypeOutEntity> getPaymentTypeOutList(Calendar start, Calendar end, WarehouseEntity warehouse, PartnerEntity partner, CurrencyEntity currency, int type, boolean valid, boolean status) { Session session = this.sessionFactory.getCurrentSession(); Criteria c = session.createCriteria(PaymentTypeOutEntity.class, "paymenttypeout"); c.createAlias("paymenttypeout.paymentout", "paymentout"); c.add(Restrictions.between("paymentout.date", start, end)); if (warehouse != null) { c.add(Restrictions.eq("paymentout.warehouse", warehouse)); }//from w w w. ja v a 2 s . c o m if (currency != null) { c.add(Restrictions.eq("paymentout.currency", currency)); } if (partner != null) { c.add(Restrictions.eq("paymentout.partner", partner)); } if (type < 4) { c.add(Restrictions.eq("type", type)); } c.add(Restrictions.eq("paymenttypeout.valid", valid)); c.add(Restrictions.eq("paymenttypeout.status", status)); c.addOrder(Order.asc("paymentout.date")); c.setResultTransformer(CriteriaSpecification.DISTINCT_ROOT_ENTITY); return c.list(); }
From source file:net.purnama.pureff.dao.PaymentTypeOutDao.java
public List<PaymentTypeOutEntity> getPaymentTypeOutList(Calendar start, Calendar end, WarehouseEntity warehouse, PartnerEntity partner, CurrencyEntity currency, boolean status) { Session session = this.sessionFactory.getCurrentSession(); Criteria c = session.createCriteria(PaymentTypeOutEntity.class, "paymenttypeout"); c.createAlias("paymenttypeout.paymentout", "paymentout"); c.add(Restrictions.between("paymentout.date", start, end)); if (warehouse != null) { c.add(Restrictions.eq("paymentout.warehouse", warehouse)); }/*from w ww.ja va 2 s . c om*/ if (currency != null) { c.add(Restrictions.eq("paymentout.currency", currency)); } if (partner != null) { c.add(Restrictions.eq("paymentout.partner", partner)); } c.add(Restrictions.eq("paymentout.status", status)); c.addOrder(Order.asc("paymentout.date")); c.setResultTransformer(CriteriaSpecification.DISTINCT_ROOT_ENTITY); return c.list(); }
From source file:net.purnama.pureff.dao.PaymentTypeOutDraftDao.java
public List getPaymentTypeOutDraftList(PaymentOutDraftEntity paymentoutdraft) { Session session = this.sessionFactory.getCurrentSession(); Criteria c = session.createCriteria(PaymentTypeOutDraftEntity.class); c.add(Restrictions.eq("paymentoutdraft", paymentoutdraft)); c.addOrder(Order.asc("date")); c.setResultTransformer(CriteriaSpecification.DISTINCT_ROOT_ENTITY); return c.list(); }