[
https://issues.apache.org/jira/browse/CAY-2807?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Andrus Adamchik updated CAY-2807:
---------------------------------
Description:
EntityProperty has a few polymorphic methods to bind "in" and "nin" ID arrays.
E.g. for "in":
{noformat}
Expression inId(Collection<Object> ids)
Expression inId(Object firstId, Object... moreIds)
{noformat}
This API has a few issues - parameter ambiguity (e.g. code trying to bind IDs
as a "Set<String>" would hit the second (vararg) method instead of the desired
first method), and inability to bind an Object[].
We need to redesign this API to address the two problems above... Maybe smth
like this:
{noformat}
Expression idsIn(Object... ids)
Expression idsInCollection(Collection<?> ids)
{noformat}
Other candidates for similar redesign:
{noformat}
EntityProperty.ninId(..)
CollectionProperty.contains(..)
CollectionProperty.containsId(..)
CollectionProperty.notContains(..)
CollectionProperty.notContainsId(..)
MapProperty.contains(..)
MapProperty.containsId(..)
MapProperty.notContains(..)
MapProperty.notContainsId(..)
SelectById.query(..)
SelectById.dataRowQuery(..)
{noformat}
was:
EntityProperty has a few polymorphic methods to bind "in" and "nin" ID arrays.
E.g. for "in":
{noformat}
Expression inId(Collection<Object> ids)
Expression inId(Object firstId, Object... moreIds)
{noformat}
This API has a few issues - parameter ambiguity (e.g. code trying to bind IDs
as a "Set<String>" would hit the second (vararg) method instead of the desired
first method), and inability to bind an Object[].
We need to redesign this API to address the two problems above... Maybe smth
like this:
{noformat}
Expression idsIn(Object... ids)
Expression idsInCollection(Collection<?> ids)
{noformat}
> EntityProperty.inId(..) / ninId(..) - disambiguate method parameters
> --------------------------------------------------------------------
>
> Key: CAY-2807
> URL: https://issues.apache.org/jira/browse/CAY-2807
> Project: Cayenne
> Issue Type: Improvement
> Affects Versions: 4.2
> Reporter: Andrus Adamchik
> Assignee: Nikita Timofeev
> Priority: Major
> Fix For: 5.0.M1
>
>
> EntityProperty has a few polymorphic methods to bind "in" and "nin" ID
> arrays. E.g. for "in":
> {noformat}
> Expression inId(Collection<Object> ids)
> Expression inId(Object firstId, Object... moreIds)
> {noformat}
> This API has a few issues - parameter ambiguity (e.g. code trying to bind IDs
> as a "Set<String>" would hit the second (vararg) method instead of the
> desired first method), and inability to bind an Object[].
> We need to redesign this API to address the two problems above... Maybe smth
> like this:
> {noformat}
> Expression idsIn(Object... ids)
> Expression idsInCollection(Collection<?> ids)
> {noformat}
> Other candidates for similar redesign:
> {noformat}
> EntityProperty.ninId(..)
> CollectionProperty.contains(..)
> CollectionProperty.containsId(..)
> CollectionProperty.notContains(..)
> CollectionProperty.notContainsId(..)
> MapProperty.contains(..)
> MapProperty.containsId(..)
> MapProperty.notContains(..)
> MapProperty.notContainsId(..)
> SelectById.query(..)
> SelectById.dataRowQuery(..)
> {noformat}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)