2

I have all the QueryDSL jars referenced from the all directory in my libraries. My problem NetBeans is not seeing the "Q"objects. They are generated to the same directory as all the other JPA entity objects with "_". Secondly if I use a "Q" object it does compile, but the editor itself does not see it and thinks it is an error.

Anyone have any ideas? I tried editing the Ant file but I failed at that as well. It does not seem that I need to edit it specifically for generation. The main problem appears to be linking to the NetBeans editor.

BTW I did look at this link and I already did this! How to setup classpath in Netbeans?

Also I have this problem on both Mac OSX and Ubuntu Netbeans. Help is appreciated!!

Community
  • 1
  • 1
Nick
  • 1,174
  • 11
  • 20
  • 1
    The standard JPA metamodel classes are available without errors? Both APT processors are configured in the same way. I am using Eclipse, so just asking questions for now. – Timo Westkämper Nov 02 '11 at 16:57
  • I just tried blowing away the entity classes that were generated originally. Then regenerated them, CLEAN then build and now the Q objects are being seen. I have no idea why. – Nick Nov 02 '11 at 18:35
  • I figured out a way.. I tried to post answer but the rules will not allow me to. POST \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ Looks like I found a work around. It also appears it is a Bug in NetBeans. Work around is: Go to your home directory and netbeans hidden directory. Should be on linux and maybe Mac OSX ~/.netbeans/7.0/var/cache/index . Delete all sub folders within the index directory. Also make sure Netbeans is shutdown. Restart NetBeans and build as it should have the correct caching now. This sucked! – Nick Nov 02 '11 at 19:09
  • Are you forced to use NetBeans? Eclipse and IDEA are good alternatives. – Timo Westkämper Nov 02 '11 at 19:19
  • No, but I really dislike Eclipse. Especially for web and JPA development. Eclipse has been way more buggy for me recently. This is my first issue with NetBeans. – Nick Nov 02 '11 at 23:41
  • I still can not get the Q objects to work with my one project. – Nick Nov 02 '11 at 23:41

2 Answers2

1

Best fix that is consistent is to go to project properties and add the build/generated-sources as a Source package Folder in Sources.

Nick
  • 1,174
  • 11
  • 20
0

I had the same problem. I did a clean & Build, on the project and that did it for me. I could clearly see the java files being generated, and the class files are not getting in the path. Clean did the trick for me.

Krishna Vedula
  • 1,643
  • 1
  • 27
  • 31