posted 1 year ago
Hi all,
I am trying to use a named query with an IN clause, but it does not work;
My IDE forces to add the parenthesis around the :mailingIDList, all of the documentation I find about using the IN clause says I do not need the parenthesis.
I am using eclipseLink 2.5.0.
Here is what the method containing the entityManager executing the JPA looks like:
Not sure what the problem is, if I remove the parentheisis I get a syntax error on the query in my IDE.
I get a failure with the parenthesis around the :mailingIDList of;
You have attempted to set a value of type class java.util.HashSet for parameter mailingIDList with expected type of class java.lang.Integer from query string SELECT m FROM MarketingMailingIDMRMXRef m WHERE m.mailingID IN (:mailingIDList).
I think my problem is with EclipseLink not allowing me to not use a parenthesis, but how do I get around that?
I am trying to use a named query with an IN clause, but it does not work;
My IDE forces to add the parenthesis around the :mailingIDList, all of the documentation I find about using the IN clause says I do not need the parenthesis.
I am using eclipseLink 2.5.0.
Here is what the method containing the entityManager executing the JPA looks like:
Not sure what the problem is, if I remove the parentheisis I get a syntax error on the query in my IDE.
I get a failure with the parenthesis around the :mailingIDList of;
You have attempted to set a value of type class java.util.HashSet for parameter mailingIDList with expected type of class java.lang.Integer from query string SELECT m FROM MarketingMailingIDMRMXRef m WHERE m.mailingID IN (:mailingIDList).
I think my problem is with EclipseLink not allowing me to not use a parenthesis, but how do I get around that?
Persistence equals goals
SCJP
posted 1 year ago
The problem is with the parentheses. Right now, you're saying that you want to filter the mailingId using a list of Set<Integer>. If you provide parentheses in the IN query, you can only provide a single element (or multiple if you provide multiple parameters within the parentheses). If you omit the parentheses you can provide a collection of elements.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions

Don't get me started about those stupid light bulbs. |