com.force.sdk.jpa.query
Class CollectionParameter
java.lang.Object
com.force.sdk.jpa.query.CollectionParameter
public class CollectionParameter
- extends Object
Use this class to encapsulate collection parameters. The toString() method is overridden to
return a properly serialized String representation of the collection, appropriate for SOQL
queries.
String collections get all members wrapped. So [AAA,BBB] --> ('AAA', 'BBB')
Date/Calendar collections get serialized according to SOQLDateFormatUtil formatting methods.
All other collection types rely on their respective toString() methods. So [1,2,3] --> (1,2,3)
- Author:
- Saptarshi Roy
Method Summary |
String |
toString()
Given a collection of unknown type, return a serialized String representation of the collection
appropriate to inclusion in SOQL queries. |
CollectionParameter
public CollectionParameter(Collection<?> collection)
- Stores off the given collection for use with the toString() method later.
- Parameters:
collection
- the collection that will be formatted as a String for SOQL queries
toString
public String toString()
- Given a collection of unknown type, return a serialized String representation of the collection
appropriate to inclusion in SOQL queries.
Empty arrays return the value NULL, resulting in queries like '... WHERE Id IN (NULL). This works in SOQL
independent of type.
Strings are wrapped in single quotes.
All other types are returned as simple comma separated lists.
- Overrides:
toString
in class Object
- Returns:
- A serialized String representation of the collection appropriate for SOQL IN clause queries.
Copyright © 2011. All Rights Reserved.