This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
When building a JPA query (code, not annotations), beans attributes and beans names are not being offered. Piece of code: static List<Product> getProducts(String code) { EntityManager em = null; try { em = BrokerUtil.getEntityManager(); TypedQuery<Product> qry = em.createQuery("select distinct O from Product O where O.|", Product.class); } finally { BrokerUtil.closeEntityManager(em); } then at cursor position "|" I do type Ctrl+Space and nothing happens. In NetBeans 8.0 it works as expected, provinding options regarding Product object. Regards, Edson
I've downgraded to 8.0 for testing purposes. It worked fine. After, I've return to 8.0.1, and now it is working again. I'll lower the prio to P2, but Carl Mosca (in NetCat list) have been able to reproduce the problem, would worth to ask if a NetBeans reboot would bring code completion back to work.
I am willing to try again. Did you restart NetBeans only or a complete wipe/reinstall? I believe I did the former.
Created attachment 148913 [details] Messages.log from the session that had the problem
Created attachment 148914 [details] Screen capture illustrating "confused" code completion/warnings.
(In reply to carljmosca from comment #2) > I am willing to try again. Did you restart NetBeans only or a complete > wipe/reinstall? I believe I did the former. Actually, I wanted to test in previous release (8.0), which I still have installed. My installation is /opt/netbeans-8.0 : my old installation /opt/netbeans-8.0.1 : my new installation I run everything from /opt/netbeans, so what I did was sudo mv /opt/netbeans-8.0 /opt/netbeans Then I've run the tests. After, I've closed NetBeans and moved the 8.0.1 back: sudo mv /opt/netbeans /opt/netbeans-8.0 sudo mv /opt/netbeans-8.0.1 /opt/netbeans Started NetBeans, and after traditional 'background scanning', everything went back to life. I'm sure there is something there, but I can't tell for sure how to reproduce. Good to see you have been able to upload a screen capture.
I think in your screen capture there is something a bit confusing. If you have a class class Customer { private String name; public String getName() { return name; } public void setName(String n) { this.name = n; } } then you JPA query must be something like TypedQuery<Customer> qry = em.createQuery("select O.name from Customer O where O.name = 'Carl'", Customer.class); Otherwise, it will report wrong syntax. Please, double check if after type O.| the bean attributes are offered. My issue is because those attributes are not being offered as option.
Yes, it's been a long day. :) You are correct but that does not correct the problem for me. (I had tried "correct" syntax in my earlier testing.) Code completion/warnings seem to come and go. I thought it may be having trouble connection to the database because at one point I got some sort of "resolving" message (I did not capture it).
(In reply to carljmosca from comment #7) > Yes, it's been a long day. :) > > You are correct but that does not correct the problem for me. (I had tried > "correct" syntax in my earlier testing.) > > Code completion/warnings seem to come and go. > > I thought it may be having trouble connection to the database because at one > point I got some sort of "resolving" message (I did not capture it). I don't think that a database connection is required: JPA is about querying objects, and the database connection is necessary only at runtime. But I agree: the problem come and go without clear explanation why. I could not see anything relevante in logs. May be someone at Oracle is able to reproduce the problem and discover the cause. I know that 8.0.1 had some improvements in code completion/indexing, and I do believe that there is something related - but I can't prove anything so far. Thanks for your help on working in this issue. Regards, Edson
Happy to...thank you for reporting it. Code completion is something I generally take advantage of in NetBeans whenever possible. :) Take care, Carl
One more (possibly unrelated) issue...back to my original use case, the annotations. @NamedQuery seems to work well but @NamedNativeQuery does not seem to at all currently. Is this by design? I am asking because native queries seem to have very nice code completion in the NB SQL editor.
There should be no difference in complettion in .createQuery(" and query=" the only possible difference is parsing/index ready may be cache problems with 8-8.0.1 upgrade?
shotscreen seems to show valid warning
Jpa features are heavily dependent on index/parsing/cache, if it's by occasion became corrupted there are two problems - it's hard to find out when exactly it became corrupted and why to file corresponding issue and argue proper evaluation, I suppose it's really hard to get details for evaluation in this case. - because of above it's hard to evaluate in persistence area If you can't reproduce yourself, it's really hard to proceed with the issue. I may need to try fcs also, but in 20140731 I can't reproduce and there was no changes in jpa after this build and no much changes elsewhere
finally I can't reproduce with 8.0.1, I can cc at supposed place without any problem. unfortunately it's hard to continue evaluation as nobody can reproduce the issue now it's hard to estimate what nb area is reproducible in this case also. in my opinion something should happens in scanning phase.
You are completely right. I can't provide a "steps to follow" on this. Perhaps, I could not reproduce the error anymore after downloading the final (production) version. Thanks and sorry for the false alarm. Regards, Edson Richter