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.

Bug 217587 - JPQL editor disabled for persistence.xml in Maven projects and web apps
Summary: JPQL editor disabled for persistence.xml in Maven projects and web apps
Status: RESOLVED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Persistence (show other bugs)
Version: 7.3
Hardware: PC Mac OS X
: P3 normal (vote)
Assignee: Sergey Petrov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-29 17:17 UTC by Kenneth Ganfield
Modified: 2012-09-25 12:14 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kenneth Ganfield 2012-08-29 17:17:54 UTC
When invoking popup menu on persistence.xml in Maven Java SE and web projects or Java web apps, the Run JPQL Query menu item is disabled.
Comment 1 Sergey Petrov 2012-08-29 21:01:48 UTC
It's expected in 7.3, but may be item need to be removed instead of disabled.
7.3 will contain jpql editor for ant j2se only.
as web project is run in a container(and persistence.xml contain corresponding properties) even if it will be possible to enable it on nb side for web projects, it will require special handling and may be realized in future releases.
Comment 2 Kenneth Ganfield 2012-08-30 10:28:55 UTC
ok, would be nice to have this for Maven J2SE for 7.3
Comment 3 Sergey Petrov 2012-09-12 10:37:31 UTC
http://hg.netbeans.org/web-main/rev/8313e1a22c82 enabled for maven j2se
if it's good to remove instead of disable for web, it may be better to track as separate issue now
Comment 4 Quality Engineering 2012-09-13 02:11:12 UTC
Integrated into 'main-golden', will be available in build *201209130001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/8313e1a22c82
User: Sergey B. Petrov <sj-nb@netbeans.org>
Log: #217587 enable jpql editor in maven j2se
Comment 5 Petr Jiricka 2012-09-14 19:13:21 UTC
Hi Sergey, so are you saying that for web projects the difficulty is that we need to launch the container? We already have some support for the embeddable container for testing, could we reuse that? Cc'ing David who implemented the embeddable container support.
Comment 6 Sergey Petrov 2012-09-14 19:41:01 UTC
At least special handling is required and feature fall out of 7.3 scope because of limited time. embedded container may not solve everithing as thee should be datasource configured the same way as in target container. I have some ideas to substitute datasource properties with connection properties, add provider property, and run as resource_local but can't say if it's easy or not and ifthere are any issues, it's just ideas about realization
Comment 7 David Konecny 2012-09-16 20:54:43 UTC
Sergey, could you tell me please why this cannot be enabled for Web Projects? I would think that all you need is a data source similarly like in "Entity from DB" wizard. Or am I missing something? Thanks.
Comment 8 Sergey Petrov 2012-09-17 05:12:05 UTC
web application can be run on server only, jpql execution is similar to main class execution but user do not have to right own code and need to build once instead of rebuild after each jpql change.
persistence do nothing with user's application yet but in case of web some actions similar to 'entity from db' will be required but I expect it will not be enough.
Comment 9 Sergey Petrov 2012-09-17 06:52:33 UTC
one more item is classpath. for j2se it's expected to have everithing inside but for ee it's expected to have a lot of libraries on server side and it may be more worst issue for realization compare to issue with datasource->jdbc url converting.
Comment 10 David Konecny 2012-09-17 22:49:11 UTC
Thanks for the explanation. I understand it now. Yes, the embeddable container should help in this case. If I remember it correctly each server which is supporting the embeddable container returns a new type of classpath which can be used to run for example unit tests in the embeddable container. "j2ee.platform.embeddableejb.classpath" classpath property. You should be able to just run your code in this classpath *in theory*.
Comment 11 Sergey Petrov 2012-09-25 12:14:24 UTC
jpql editor may be switched on for web, it's under investigation and preliminary results seems promising