Community
Participate
Working Groups
@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".
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