I done a git clone of spring data - jpa.
I search a way when I running test to see generated query.
I done a git clone of spring data - jpa.
I search a way when I running test to see generated query.
I have tested with the followings:
Edit the /src/test/resources/META-INF/persistence.xml
file and add the following two lines in the <properties>
section of cdi
, cdi-52
, merchant
, metadata
and metadata-52
persistence-unit.
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.format_sql" value="true"/>
Add the below line in the <properties>
section of the same file's persistent-unit named metadata_oj
<property name="openjpa.Log" value="SQL=Trace" />
Edit the src/test/resources/eclipselink.xml
file and rewrite below section as :
<util:properties id="jpaProperties">
<prop key="javax.persistence.jdbc.driver">org.hsqldb.jdbcDriver</prop>
<prop key="javax.persistence.jdbc.url">jdbc:hsqldb:mem:hades</prop>
<prop key="javax.persistence.jdbc.user">sa</prop>
<prop key="javax.persistence.jdbc.password"></prop>
<prop key="javax.persistence.ddl-generation">create-tables</prop>
<prop key="eclipselink.logging.level.sql">FINE</prop>
<prop key="eclipselink.logging.parameters">true</prop>
</util:properties>
Also, edit the below section of src/test/resources/openjpa.xml
file as:
<util:properties id="jpaProperties">
<prop key="openjpa.Log">SQL=Trace</prop>
</util:properties>
Then, you can run mvn test
to test the project and check whether you can see the generated queries or not.