vendredi 12 janvier 2018

When can criteria.list of Hibernate API throw java.lang.reflect.InvocationTargetException?

for (Iterator iterator = uniqueEntries.iterator(); iterator.hasNext();) {
        Entry<String, String> entry = (Entry<String, String>) iterator.next();
        criteria.add(Restrictions.eq(entry.getKey(),entry.getValue())); 
    }
List<CustomClass> list = criteria.list();

In the above loop I am adding restrictions to the criterias which works fine. But the criteria.list() method throws an exception "java.lang.reflect.InvocationTargetException".

Can someone explain what could be the reason for this ?





Aucun commentaire:

Enregistrer un commentaire