Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 354482

Summary: Can't set primitive type from ui as @NamedNativeQuery#resultClass
Product: [WebTools] Dali JPA Tools Reporter: Dmitry Geraskov <geraskov>
Component: JPAAssignee: Neil Hauge <neil.hauge>
Status: NEW --- QA Contact:
Severity: minor    
Priority: P3 CC: neil.hauge
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Allow primitives none

Description Dmitry Geraskov CLA 2011-08-11 08:33:46 EDT
Build Identifier: I20110613-1736

Can't set primitive type from JPA Details view as @NamedNativeQuery#resultClass

Reproducible: Always

Steps to Reproduce:
1. Create enitty
2. Open JPA Details view
3. Open Queries
4. Add NamedNativeQuery
5. set void or int like resultClass in ui
FAILURE: in source you'll see 'voi' or 'in'
Comment 1 Dmitry Geraskov CLA 2011-08-11 08:35:54 EDT
Created attachment 201310 [details]
Allow primitives

Result class also could be a primitive class, should be allowed.
Comment 2 Neil Hauge CLA 2011-08-11 18:24:19 EDT
The current behavior isn't very desirable, but wouldn't you only specify the resultClass if you were identifying an entity?  Seems odd to specify an int as the result class.  Regardless, there is some work to be done here.
Comment 3 Dmitry Geraskov CLA 2011-08-12 03:47:05 EDT
Nail,
I expected it is possible to execute a query like "SELECT count(emp1.emp_id) FROM emp emp1" with int.class result, but this is really not possible, and even Integer.class does't work. So I think the issue should be rejected.
Comment 4 Neil Hauge CLA 2011-08-12 16:36:58 EDT
Ideally our UI would handle this more gracefully, so I would like to leave this bug open, but it probably isn't very likely that we will fix it directly.
Comment 5 Neil Hauge CLA 2012-04-10 11:24:09 EDT
Comment on attachment 201310 [details]
Allow primitives

Marking this patch as obsolete for reporting purposes.