Bug 282962 - AddQueryDialog doesn't support attribute query for NamedQuery
Summary: AddQueryDialog doesn't support attribute query for NamedQuery
Status: NEW
Alias: None
Product: Dali JPA Tools
Classification: WebTools
Component: JPA (show other bugs)
Version: 2.2   Edit
Hardware: PC Windows XP
: P3 trivial (vote)
Target Milestone: ---   Edit
Assignee: Neil Hauge CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2009-07-09 02:40 EDT by Dmitry Geraskov CLA
Modified: 2011-07-01 16:24 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry Geraskov CLA 2009-07-09 02:40:44 EDT
Steps To Reproduce:
1. Select entity and open JPA Detailes view
2. Go to the Queries pane
3. Click Add
4. Observe that you can't set necessary *query* attribute.
5. Create Names Query with any name.
6. See compilation error: The annotation @NamedQuery must define the attribute query.


AddQueryDialog dialog should worry about the attribute.
Comment 1 Neil Hauge CLA 2009-08-03 11:56:28 EDT
We try to keep the dialogs very simple in the Dali UI, in this case keeping the query entry in the form versus the dialog.  This does result in an error situation, so I see your point in entering the bug.  I think in this case it is better to have the error than to have the user stuck in a modal dialog while they are writing a query.

Other thoughts?

Comment 2 Dmitry Geraskov CLA 2009-08-14 04:15:08 EDT
What if do not make query field mandatory in the dialog?
Comment 3 Neil Hauge CLA 2009-08-14 10:57:27 EDT
Actually, there is another possible remedy here that solves the error condition and doesn't involve putting the query text area into the dialog.  A colleague of mine suggested that we could simply add a template query to the query text when completing the dialog.  This query template could be selected by default for easy type-over.

So, for a Named or Named Native Query we could populate the query text with:

SELECT [select_expression] FROM [entityName] WHERE [conditional_expression]

The template could probably be further customized for named or native named, and use the context of the Entity.  




Comment 4 Dmitry Geraskov CLA 2009-08-17 03:16:14 EDT
Good point. You would be able to add CompletionProposals in future.
Comment 5 Neil Hauge CLA 2011-07-01 16:24:53 EDT
Moving JPA specific bugs to new JPA component in bugzilla.