Home » Support » Forum » String representation of a query

String representation of a query

#1

Hi,

Is it possible to get a JPQL string having a Query object instance? JpaQuery class doesn't have any method like "getQueryString" or "getDatabaseQuery", maybe it's going to be added in near future? It would be very useful to have something similiar to :

queryObject.unwrap(com.objectdb.jpa.JpaQuery.class).getQueryString()

I would like to measure time of query execution and log that information with JPQL string and parameters map to find and optimize the most ineffective cases.

#2

Following your request a toString implementation that returns the query string was added to queries.

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

Thank you, works perfectly.


Post Reply

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