예제 #1
0
  public List regionsByExample(Countries countries) {

    Criteria cri = session.createCriteria(Countries.class);
    Example exam = Example.create(countries);
    cri.add(exam);
    return cri.list();
  }
예제 #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();
  }