Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] org.hibernate.criterion.Example equivalent in Eclipselink

 In Hibernate I use to write the following generic code and utilize
hibernates org.hibernate.criterion.Example.

 public List<T> findByExample(T exampleCriteria) {
  final T t = exampleCriteria;
  List<T> list = (List<T>) getJpaTemplate().execute(new JpaCallback() {
   public Object doInJpa(javax.persistence.EntityManager em)
     throws javax.persistence.PersistenceException {
    final Example example = Example.create(t).excludeZeroes();

    Criteria criteria = ((Session) em.getDelegate())

    return criteria.list();
  return list;

Whats an equivalent in EclipseLink?? 
View this message in context:
Sent from the EclipseLink - Users mailing list archive at

Back to the top