Bug 534284 (RHQ-1095)

Summary: make hibernate.jsp work for non-string bind parameters
Product: [Other] RHQ Project Reporter: Joseph Marques <jmarques>
Component: Core UIAssignee: Joseph Marques <jmarques>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: low    
Version: unspecifiedCC: cwelton
Target Milestone: ---Keywords: FutureFeature, Improvement
Target Release: ---   
Hardware: All   
OS: All   
URL: http://jira.rhq-project.org/browse/RHQ-1095
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-03-29 19:34:56 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Joseph Marques 2008-11-09 21:47:00 UTC
seems when there is a parameterized query, it only works for string types.  it auto-renders input fields for the params, but bombed when the parameters mapped to integers.  

Comment 1 Red Hat Bugzilla 2009-11-10 20:23:50 UTC
This bug was previously known as http://jira.rhq-project.org/browse/RHQ-1095


Comment 2 wes hayutin 2010-02-16 17:10:20 UTC
mass add of key word FutureFeature to help track

Comment 3 Joseph Marques 2010-02-19 07:42:35 UTC
committed to master -- 195e7a1dd15ed80a86e8f6bcc1e2787d511de3a9

* support binding to boolean as well as all numeric basic types;
* support binding to enums (user can enter ordinal or name [case-insensitively] of enum);
* support binding to entities (user can enter id / primary key);
* modify label for input field next to each query parameter to give a brief explanation of how it's supported;

hibernate.jsp now supports all of the following queries:

SELECT res FROM Resource res WHERE res.name IN ( :item ) // string
SELECT res FROM Resource res WHERE res.id IN ( :item ) // integer
SELECT res FROM Resource res WHERE res.ctime IN ( :item ) // long
SELECT res FROM Resource res WHERE res.connected IN ( :item ) // boolean
SELECT res FROM Resource res WHERE res.inventoryStatus IN ( :item ) // enum
SELECT res FROM Resource res WHERE res IN ( :item ) // entity type

Comment 4 Corey Welton 2010-03-29 17:31:31 UTC
Needs Repro steps.

Comment 5 Corey Welton 2010-03-29 17:32:27 UTC
Mass-move to ON_QA

Comment 6 Joseph Marques 2010-03-29 17:40:40 UTC
This can be considered a development debugging / testing page, and doesn't need to be tested for customer release.  However, my last comment basically are the reproduction steps.  The page "/admin/test/hibernate.jsp" now supports binding to all of the previously mentioned parameter types - string, integer, long, boolean, enum, and entities.  If you enter those queries, you'll see that the page doesn't blow up, and will give an input box for you to enter the value of the ":input" parameter.  You should be able to enter a string version of those parameters and the query will return results (again, instead of blowing up).  For all non-obvious bind parameter types, the UI now gives instructions for how to enter a value it will accept.

Comment 7 Corey Welton 2010-03-29 19:34:56 UTC
QA Closing.