Home / Java Patterns and Pitfalls     frequal.com

JPQL Syntax Checking In NetBeans

NetBeans automatically checks JPQL queries! Look for the yellow warning icon in the line numbers. Hover on it and it tells you a full list of syntax errors.

How to Use It

First, write a JPQL query in a .java file. JPA Entities with @NamedQuery annotations are a popular place.

Next, look for the yellow light bulb with a caution triangle in the left margin, where the line numbers are. Hover over the icon and a list of all problems will be shown.

I have found it very helpful debugging complex where clauses, and for identifying misuses of JPQL that are legal in SQL.

Kudos

Thanks to Josh Juneau, whose article NetBeans Java EE Tip #2: JPQL Syntax Checking first alerted me to this valuable feature that has been under my nose for years.
Last modified on 8 Sep 2024 by AO

Copyright © 2024 Andrew Oliver