How to test your JPQL / HQL without a Deploy

2

Posted on June 27, 2012 by

Share it now!

Hello, how are you?

Have you ever wanted to test your JPQL / HQL without doing a full deploy of your application?

What we will see here today is simple solution that works for any JPA implementation: Hibernate, OpenJPA, EclipseLink and others.

The base source code found in this post came from this book: “Pro JPA 2: Mastering the Java™ Persistence API – Mike Keith, Merrick Schincariol”. This post will add to the original code: query parameters and NamedQuery test.

The post contents:

  • Page 02: Model classes and data Generation
  • Page 03: Abstract test class
  • Page 04: Dynamic Query test
  • Page 05: NamedQuery test
  • Page 06: Running the application
  • Page 07: Using this post code with your application code
  • Page 08: Proposals

You will find the source code of this post in the last page.

In the page 07 you will see how to apply the code of this post to the code of your application.

Response to How to test your JPQL / HQL without a Deploy

Leave a Reply

Your email address will not be published. Required fields are marked *


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Current day month ye@r *