You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jdo-dev@db.apache.org by "Matthew T. Adams (JIRA)" <ji...@apache.org> on 2019/02/12 14:35:00 UTC

[jira] [Commented] (JDO-777) Changing the signature of JDOQLTypedQuery.numericParameter, listParameter, setParameter, and mapParameter

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

Matthew T. Adams commented on JDO-777:
--------------------------------------

For consistency with the existing methods, I'd switch the order of the parameters, such that parameters that are the same across overloaded methods are listed first, then optionals and parameters from overloaded methods follow:

{color:#333333}<N> NumericExpression<{color:#20999d}N{color}> numericParameter(String name, Class<N> type);{color}

> Changing the signature of JDOQLTypedQuery.numericParameter, listParameter, setParameter, and mapParameter
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: JDO-777
>                 URL: https://issues.apache.org/jira/browse/JDO-777
>             Project: JDO
>          Issue Type: Improvement
>          Components: api
>    Affects Versions: JDO 3.1
>            Reporter: Michael Bouschen
>            Priority: Major
>             Fix For: JDO 3.2
>
>
> Class JDOQLTypedQuery provides a method to create a numeric patameter for a query:
> {{NumericExpression<?> numericParameter(String name);}}
> This signature does not support the creation of a numeric parameter of type NumericExpression<Double> that is then used in methods like lt or gt taking a double field as an argument. 
> I propose to add an overloaded method with the following signature:
> {{<{color:#20999d}N{color}> NumericExpression<{color:#20999d}N{color}> numericParameter(Class<{color:#20999d}N{color}> type, String name);}}
> I propose a corresponding extension for methods collectionParameter, mapParameter and listParameter:
> {{<{color:#20999d}E{color}> CollectionExpression<Collection<{color:#20999d}E{color}>, {color:#20999d}E{color}> collectionParameter(Class<{color:#20999d}E{color}> elementType, String name);}}
> {{<{color:#20999d}K{color},{color:#20999d}V{color}> MapExpression<Map<{color:#20999d}K{color},{color:#20999d}V{color}>, {color:#20999d}K{color}, {color:#20999d}V{color}> mapParameter(Class<{color:#20999d}K{color}> keyType, Class<{color:#20999d}V{color}> valueType, String name);}}
> {{<{color:#20999d}E{color}> ListExpression<List<{color:#20999d}E{color}>, {color:#20999d}E{color}> listParameter(Class<{color:#20999d}E{color}> elementType, String name);}}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)