openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Phill Moran" <>
Subject How to debug object retrieveal in JPA?
Date Thu, 26 Apr 2007 19:39:24 GMT

How does one go about debugging object retrieval/creation. I continue to have
exceptions and little to go on as far as the cause.
The named JPQL is good since I know it generates a good sql (can trace code and
see it) . I know the sql is good as I can copy/paste it into mysql query
browser, execute and get the correct data back. The problem is that these lines
result in an NPE.

		Query q =
		q.setParameter("storeName", storeName.toUpperCase());
		q.setParameter("loginName", loginName.toUpperCase());
		List<Person> results = null;
		try {
		results = (List<Person>) q.getResultList();
		catch(Exception e) {
		if (results.isEmpty()) { <- NPE thrown here
			throw new UserNotFoundException("No user found");
Also the "mappingTool validate" seems to work fine. Of course how would I know
since I can find no description of what a good one looks like but reading it (no
exceptions) seem to make sense. 

Any help would be much appreciated.


View raw message