Query debugging configuration from class

#1

Is there a way to show what queries are actually being executed from within a Java class?

I'm getting the exception:

Exception in thread "main" [ObjectDB 2.5.4_05] javax.persistence.NonUniqueResultException

However, I'm unable to debug it because I don't know what the query's actually searching for. I would like to log (in the console or in a separate log file) what it's actually executing without setting it in xml but rather through Java if possible?

#2

If you have the Query instance (e.g. in a catch clause), you should be able to use toString to obtain the query string.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)

Post Reply

To post a reply and/or subscribe to update notifications - please login