Beginner |
 |
Joined: Thu Jan 20, 2005 1:45 pm Posts: 49
|
Hi all
I have a function that uses Example API with MacthMode.EXACT.
The problem is that when i passed it an object with just its id specified, the functions return me all records starting with that id.
I need an EXACT search matchmode.I already specified it in MatchMode.EXACT but the problem is not solved.
My function :
public Collection findByExample(Object example) throws PersistenceException {
log.info("findByExample...");
Collection collection;
try {
Criteria crit = HibernateSessionFactory.getSession()
.createCriteria(mappedClass);
collection = crit.add(Example.create(example).enableLike(MatchMode.EXACT)).list();
} catch (HibernateException ex) {
throw new PersistenceException(ex);
}
return collection;
}
|
|