Hi
I have a dao class which looks something like this:
@JpaUnit
@Transactional
public class PhoneJPADao implements PhoneDao {
...
@Override
@Transactional(exceptOn = SQLException.class)
public List<Pilot> findPilots(int from, int count, String sortProperty,
boolean sortAsc, SearchCriteriaPilot searchCriteriaPilot) {
logger.debug("findPilots");
Query query = getEntityManager().createQuery(
"select p from " + Pilot.class.getSimpleName() + " p "
+ searchCriteriaPilot.getJPASnipplet() + " order by p."
+ sortProperty + " " + getAscOrDesc(sortAsc));
query.setFirstResult(from);
query.setMaxResults(count);
try {
List resultList = query.getResultList();
for (Object object : resultList) {
getEntityManager().refresh(object);
}
return resultList;
} catch (Exception e) {
return Collections.emptyList();
}
}
...
Now above contains a like criteria and in some cases it will throw an
error about fetch first because the statement returned 0 rows, I
havent found out howto turn off fetch first. Thats why I am catching
the exception and are returning an empty list. However warp persist
will mark the method bad thus the method never suceeds.. I have tried
removing the annotation from the method but that does not help and
removing the annotation from the class is not an option.
What should I do?
regards Nino
--
You received this message because you are subscribed to the Google Groups "warp-core" group.
To post to this group, send email to
warp...@googlegroups.com.
To unsubscribe from this group, send email to
warp-core+...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/warp-core?hl=en.