Search code examples
netbeansjpa-2.0jpqlnetbeans-platformnetbeans-8.1

Netbeans' JPQL autocomplete feature


I'm currently using Netbeans 8.1 as my default IDE and it has the nice ability of auto-complete the JPQL queries when I CTRL space an object inside the query string, but only whether the query string is a single-lined one. If you break the query in two or more lines to fit in your screen (e.g. 128 columns) it stops auto-completing.

For instance:

-- Here the auto-complete happens properly
"SELECT p FROM Product p JOIN FETCH p.skus skus";

-- Here it doesn't
"SELECT p FROM Product p "
    + "JOIN FETCH p.skus skus";

Any help will be appreciated.


Solution

  • This is still an open item on the NetBeans bug tracker since version 7.2 of the software. The last comments there suggest that it should be fixed in 8.2, but it is still not, so you can take this to the bug tracker page and kindly ask Sergey Petrov to give this issue a higher priority.

    Perhaps Eclipse has some tools, like the Hibernate Tools plugin, that can help you with this if you are willing to switch to Eclipse.

    Or give IntelliJ IDEA a try with their JPA Console tool.