java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
java.lang.IllegalArgumentException
org.cruk.clarity.api.IllegalSearchTermException
- All Implemented Interfaces:
Serializable
Exception raised when a search for entities is provided with search
terms that are illegal. Terms can be illegal for a number of reasons:
- The term's value is null;
- The term's value is an empty collection or a zero length array;
- The term's value is a collection or an array containing a null.
It is important to not ignore missing values as the search will probably not run as intended. Typically it will return more results than one would expect, often drastically so. An example is searching for processes by input artifact ids: if the ids have been collected into a set but on a particular call that set is empty, then all processes ever run will be returned (if that term is just left out of the query, which is how the code worked before release 2.23). This is clearly not a good idea when the intention is to search for a small set.
It is still possible to use the find
method with no search terms.
In this case, the call is the same as ClarityAPI.listAll(Class)
.
-
Constructor Summary
ConstructorDescriptionIllegalSearchTermException
(String term, String message) Construct a new IllegalSearchTermException. -
Method Summary
Modifier and TypeMethodDescriptionGet the search term that caused the error.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
IllegalSearchTermException
Construct a new IllegalSearchTermException.- Parameters:
term
- The search term that is in error.message
- The message indicating why the term is in error.
-
-
Method Details
-
getSearchTerm
Get the search term that caused the error.- Returns:
- The search term.
-