I have a little problem with loading entities through the persist
framework.
I am using code along the lines of the following snippet from the
examples:
List list = persist.readList(MyClass.class, "select * from
tablespace.table where field1 = ? group by field2 order by field2",
10);
However, I always get an exception stating that the SQL statement used
is not correct. I assume that the actual SQL that is being generated
differs from what I pass as a statement.
Is there a way to see which statement the framework actually executes?
Could you please give me an example of a log4j configuration for
debugging purposes?
Thanks a lot in advance,
Che
Persist doesn't do anything to the SQL statements passed to it. The
results you get from it are exactly the same as you'd get if you were
executing your SQL using a PreparedStatement directly.
To see what's going on during the processing of each query you can set
the following in your log4j.properties file:
log4j.logger.persist.engine=DEBUG
log4j.logger.persist.parameters=DEBUG
log4j.logger.persist.results=DEBUG
log4j.logger.persist.profiling=DEBUG
I hope this helps.
Julio
Thanks a lot for your reply. I checked your source as well and saw
that there is indeed no modification of the passed sql.
The problem was my invalid sql - I was just a little confused by the
exception, which is of course modified by Persist.
Anyways, I solved the problem by passing valid sql to the method...
Thanks again,
Che