Raible's Wiki

Raible Designs
Wiki Home
News
Recent Changes

AppFuse

Homepage
  - Korean
  - Chinese
  - Italian
  - Japanese

QuickStart Guide
  - Chinese
  - French
  - German
  - Italian
  - Korean
  - Portuguese
  - Spanish
  - Japanese

User Guide
  - Korean
  - Chinese

Tutorials
  - Chinese
  - German
  - Italian
  - Korean
  - Portuguese
  - Spanish

FAQ
  - Korean

Latest Downloads

Other Applications

Struts Resume
Security Example
Struts Menu

Set your name in
UserPreferences


Referenced by
Articles
Articles_pt
CreateActions
CreateActions_de
SpringControllers_ko
ValidationAndList_pt




JSPWiki v2.2.33

[RSS]


Hide Menu

ValidationAndList


Difference between version 76 and version 75:

At line 184 changed 12 lines.
Example example = Example.create(person)
.excludeZeroes() // exclude zero valued properties
.ignoreCase(); // perform case insensitive string comparisons
try {
return getSession().createCriteria(Person.class)
.add(example)
.list();
} catch (Exception e) {
throw new DataAccessException(e.getMessage());
}
return new ArrayList();
// filter on properties set in the person object
HibernateCallback callback = new HibernateCallback() {
public Object doInHibernate(Session session) throws HibernateException {
Example ex = Example.create(person).ignoreCase().enableLike(MatchMode.ANYWHERE);
return session.createCriteria(Person.class).add(ex).list();
}
};
return (List) getHibernateTemplate().execute(callback);

Back to ValidationAndList, or to the Page History.