openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter Martinovic (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (OPENJPA-2183) Query hint "openjpa.hint.RelaxParameterTypeChecking" is reported to be unsupported and is ignored
Date Tue, 29 May 2012 09:46:24 GMT

    [ https://issues.apache.org/jira/browse/OPENJPA-2183?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13284697#comment-13284697
] 

Peter Martinovic commented on OPENJPA-2183:
-------------------------------------------

Hello Albert. Your patch works, the hint is correctly set on the query. Thank you. 

-------------------

a) Named parameters and Query.setParameter work fine!

-------------------

b) Inline string values (e.g. String whereCondition = "a.enumAttrib1 = '" + value + "'") do
not work.

There is "java.lang.ClassCastException: java.lang.String incompatible with java.lang.Enum".
It is because QueryImpl at line 826 uses Class.isAssignableFrom for parameter type checking,
I guess it should use its own method QueryImpl.assertValueAssignable, or similar, that respects
the RelaxParameterTypeChecking hint. 

-------------------

I would consider this task as resolved and suggest to reopen OPENJPA-1889 (if inline string
values are supposed to be supported).







                
> Query hint "openjpa.hint.RelaxParameterTypeChecking" is reported to be unsupported and
is ignored
> -------------------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-2183
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-2183
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jpa
>    Affects Versions: 2.1.0, 2.1.1, 2.2.0
>         Environment: Websphere 8.0.3, openjpa-2.1.2-SNAPSHOT-r422266:1227818
>            Reporter: Peter Martinovic
>            Priority: Minor
>         Attachments: OPENJPA-2183.WAS8.jar, OPENJPA-2183.patch
>
>
> Setting 
> Query q = em.createQuery(qs);
> q.setHint("openjpa.hint.RelaxParameterTypeChecking", "true");
> results in 
> Warn: "openjpa.hint.RelaxParameterTypeChecking" is not a supported query hint. May be
you meant "openjpa.hint.ParameterMarkerInQuery"?
> I assume the reason is that the openjpa.hint.RelaxParameterTypeChecking hint is not supported
by any ProductDerivation and thus being refused in org.apache.openjpa.persistence.HintHandler#record.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message