| Summary: | Lessen type restriction on query parameters | ||||||
|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Blaise Doughan <blaise.doughan> | ||||
| Component: | Eclipselink | Assignee: | Nobody - feel free to take it <nobody> | ||||
| Status: | CLOSED WONTFIX | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | eclipselink.orm-inbox, tom.ware | ||||
| Version: | unspecified | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Windows XP | ||||||
| Whiteboard: | submitted_patch | ||||||
| Attachments: |
|
||||||
Created attachment 174642 [details]
JPA - Fix
If the parameter is not of the appropriate type, try converting it using conversion manager before throwing an exception.
Investigating. Closing this bug as WONTFIX. The attached patch has a high chance of causing us to fail the JPA TCK and additionally could cause some truncation issues when using numbers. As we discussed, the solution to the issue you are seeing is to use the getParameter() API on JPA's Query class. As I understand it, you will be entering a bug related to how that API is working for you, and fixing that bug should solve your problem. The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink |
@NamedQuery(name = "findCustomerById", query = "SELECT c " + "FROM Customer c " + "WHERE c.id = :id") Currently if I have a query like the one above, if the id property on Customer is of type long, then EclipseLink expects me to bind a parameter of type long to the query. It would be useful if EclipseLink could lessen this restriction and allow me to pass a value that could be converted to the appropriate type, i.e. "1".