Example #1
0
  public List regionsByExample(Countries countries) {

    Criteria cri = session.createCriteria(Countries.class);
    Example exam = Example.create(countries);
    cri.add(exam);
    return cri.list();
  }
Example #2
0
  public List byExample(StaffRole staffRole) {

    Session session = HibernateTrain.getSession();
    Criteria cri = session.createCriteria(StaffRole.class);
    Example exam = Example.create(staffRole);
    cri.add(exam);
    return cri.list();
  }