Use eclipselink.query-results-cache.ignore-null to specify if EclipseLink caches null
query results
Values
Table 4-30 describes this query hint's values.
Table 4-30 Valid Values for query-results-cache.ignore-null
Value | Description |
---|---|
|
Ignore null results (that is, do not cache results) |
|
(Default) Do not ignore |
Usage
You can use this query hint to use query cache as a secondary key index, and allow inserts of new objects.
Examples
Example 4-61 Using query-results-cache.ignore-null in a JPA Query
import org.eclipse.persistence.config.HintValues; import org.eclipse.persistence.config.QueryHints; query.setHint("eclipselink.QUERY_RESULTS_CACHE_IGNORE_NULL", "TRUE");
Example 4-62 Using query-results-cache.ignore-null in a @QueryHint Annotation
import org.eclipse.persistence.config.HintValues; import org.eclipse.persistence.config.QueryHints; @QueryHint(name=QueryHints.QUERY_RESULTS_CACHE_IGNORE_NULL, value="TRUE");
See Also
For more information, see: