blob: 6250708d060333419cdd22be5d8824a95f2338a5 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_252) on Thu Apr 08 02:07:34 UTC 2021 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>QueryByExamplePolicy (EclipseLink 3.0.1, API Reference)</title>
<meta name="date" content="2021-04-08">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="QueryByExamplePolicy (EclipseLink 3.0.1, API Reference)";
}
}
catch(err) {
}
//-->
var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10,"i18":10,"i19":10,"i20":10,"i21":10,"i22":10,"i23":10,"i24":10,"i25":10,"i26":10,"i27":10,"i28":10,"i29":10};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage">EclipseLink 3.0.1, API Reference</div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/eclipse/persistence/queries/ObjectLevelReadQuery.html" title="class in org.eclipse.persistence.queries"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../org/eclipse/persistence/queries/QueryRedirector.html" title="interface in org.eclipse.persistence.queries"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/eclipse/persistence/queries/QueryByExamplePolicy.html" target="_top">Frames</a></li>
<li><a href="QueryByExamplePolicy.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.eclipse.persistence.queries</div>
<h2 title="Class QueryByExamplePolicy" class="title">Class QueryByExamplePolicy</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li>org.eclipse.persistence.queries.QueryByExamplePolicy</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><a href="https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</a></dd>
</dl>
<hr>
<br>
<pre>public class <span class="typeNameLabel">QueryByExamplePolicy</span>
extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>
implements <a href="https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</a></pre>
<div class="block"><p><b>Purpose</b>:
This policy defines the configuration options for a Query By Example query.
<p><b>Description</b>:
A Query By Example query is an <code>ObjectLevelReadQuery</code> where the
selection criteria is built from an example domain object passed in via <code>setExampleObject</code>.
<p>
If no policy is specified the selection criteria is built from the example
object in the following way:
<ul>
<li>Attributes of the example object set to <code>null</code> are ignored.
<li>Attributes set to the default value for their primitive type (such as
<code>0</code> for <code>int</code>) are ignored.
<li>Unmapped attributes are ignored.
<li>A domain object is returned by the query only if its values for all the
included attributes equal those set in the example object.
</ul><p>
A policy can be set on the query to:
<ul>
<li>Always consider an attribute even if set to <code>null</code>
or the default value for its type. See <a href="../../../../org/eclipse/persistence/queries/QueryByExamplePolicy.html#alwaysIncludeAttribute-java.lang.Class-java.lang.String-"><code>alwaysIncludeAttribute</code></a>.
<li>Ignore attributes set to some other special value. See
<a href="../../../../org/eclipse/persistence/queries/QueryByExamplePolicy.html#excludeValue-java.lang.Object-"><code>excludeValue</code></a>.
<li>Match a <code>null</code> attribute on the example object with domain objects that have
either <code>null</code> for that attribute also, or have set a meaningful (<code>notNull</code>) value
for that attribute. See <a href="../../../../org/eclipse/persistence/queries/QueryByExamplePolicy.html#setShouldUseEqualityForNulls-boolean-"><code>setShouldUseEqualityForNulls(boolean)</code></a>.
<li>Use specialized operations when comparing attributes set in the example object
with those set in the domain objects. Matching attributes can be those with
values greater than, less than, like, or not equal to that set in the example
object. See <a href="../../../../org/eclipse/persistence/queries/QueryByExamplePolicy.html#addSpecialOperation-java.lang.Class-java.lang.String-"><code>addSpecialOperation(java.lang.Class, java.lang.String)</code></a>.
</ul>
<p>
Note: When setting an attribute on the example object which is itself a java
object with an ObjectReferenceMapping, the mapped components of that
attribute will be considered, not the entire object. There is no limit to
how many mapped objects can be nested inside the example object.
<p>
Note: <code>setExampleObject</code> is different from <code>setSelectionObject</code> in
<code>ReadObjectQuery</code> which reads a single object by first extracting
the primary key from the selection object.
<p>
<b>Restrictions</b>:
<ul>
<li>Only attributes whose mappings are DirectToField, Aggregate (Embeddable), ObjectReference
(OneToOne) or Collection type OneToMany/ManyToMany are considered in a Query By Example object. The behaviour when an example object has attribute values for other mappings types is <b>undefined</b>.
<ul><li>To ensure the example does not include any unsupported mappings the flag <a href="../../../../org/eclipse/persistence/queries/QueryByExamplePolicy.html#setValidateExample-boolean-"><code>setValidateExample(boolean)</code></a>
should be set to true on the corresponding QueryByExamplePolicy to ensure no unsupported relationship types are used in the example.</li>
<li> For OneToMany and ManyToMany mappings the elements within the collections and the references attribute values will be added to the expression as disjuncts (OR)</li>
</ul>
</li>
</ul>
<p>
<b>Example</b>:
<BLOCKQUOTE><PRE>
// This example uses like for Strings and the salary must be greater
// than zero.
ReadAllQuery query = new ReadAllQuery();
Employee employee = new Employee();
employee.setFirstName("B%");
employee.setLastName("S%");
employee.setSalary(0);
query.setExampleObject(employee);
QueryByExamplePolicy policy = new QueryByExamplePolicy();
policy.addSpecialOperation(String.class, "like");
policy.addSpecialOperation(Integer.class, "greaterThan");
policy.alwaysIncludeAttribute(Employee.class, "salary");
query.setQueryByExamplePolicy(policy);
Vector results = (Vector) session.executeQuery(query);
</PRE></BLOCKQUOTE></div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../org/eclipse/persistence/queries/ObjectLevelReadQuery.html#setExampleObject-java.lang.Object-"><code>ObjectLevelReadQuery.setExampleObject(java.lang.Object)</code></a>,
<a href="../../../../org/eclipse/persistence/queries/ObjectLevelReadQuery.html#setQueryByExamplePolicy-org.eclipse.persistence.queries.QueryByExamplePolicy-"><code>ObjectLevelReadQuery.setQueryByExamplePolicy(org.eclipse.persistence.queries.QueryByExamplePolicy)</code></a>,
<a href="../../../../serialized-form.html#org.eclipse.persistence.queries.QueryByExamplePolicy">Serialized Form</a></dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>TOPLink/Java 3.0</dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/eclipse/persistence/queries/QueryByExamplePolicy.html#attributesToAlwaysInclude">attributesToAlwaysInclude</a></span></code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/eclipse/persistence/queries/QueryByExamplePolicy.html#shouldUseEqualityForNulls">shouldUseEqualityForNulls</a></span></code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/eclipse/persistence/queries/QueryByExamplePolicy.html#specialOperations">specialOperations</a></span></code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/eclipse/persistence/queries/QueryByExamplePolicy.html#validateExample">validateExample</a></span></code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/eclipse/persistence/queries/QueryByExamplePolicy.html#valuesToExclude">valuesToExclude</a></span></code>&nbsp;</td>
</tr>
</table>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../org/eclipse/persistence/queries/QueryByExamplePolicy.html#QueryByExamplePolicy--">QueryByExamplePolicy</a></span>()</code>
<div class="block">PUBLIC:
Constructs a default policy equal to that used when no policy is specified.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/eclipse/persistence/queries/QueryByExamplePolicy.html#addSpecialOperation-java.lang.Class-java.lang.String-">addSpecialOperation</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a>&nbsp;attributeValueClass,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;operation)</code>
<div class="block">PUBLIC:
Allows operations other than <code>Expression.equal</code> to be used
for comparisons.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/eclipse/persistence/queries/QueryByExamplePolicy.html#alwaysIncludeAttribute-java.lang.Class-java.lang.String-">alwaysIncludeAttribute</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a>&nbsp;exampleClass,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;attributeName)</code>
<div class="block">PUBLIC:
Always considers the value for a particular attribute as meaningful in a
query by example.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code><a href="../../../../org/eclipse/persistence/expressions/Expression.html" title="class in org.eclipse.persistence.expressions">Expression</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/eclipse/persistence/queries/QueryByExamplePolicy.html#completeExpression-org.eclipse.persistence.expressions.Expression-java.lang.Object-java.lang.Class-">completeExpression</a></span>(<a href="../../../../org/eclipse/persistence/expressions/Expression.html" title="class in org.eclipse.persistence.expressions">Expression</a>&nbsp;expression,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;attributeValue,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a>&nbsp;attributeValueClass)</code>
<div class="block">INTERNAL:
This method is used to determine which operation to use for comparison (equal, or a special operation).</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code><a href="../../../../org/eclipse/persistence/expressions/Expression.html" title="class in org.eclipse.persistence.expressions">Expression</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/eclipse/persistence/queries/QueryByExamplePolicy.html#completeExpressionForNull-org.eclipse.persistence.expressions.Expression-">completeExpressionForNull</a></span>(<a href="../../../../org/eclipse/persistence/expressions/Expression.html" title="class in org.eclipse.persistence.expressions">Expression</a>&nbsp;expression)</code>
<div class="block">INTERNAL:
This method is used when the attribute value is null, but it has
to be included at all times.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/eclipse/persistence/queries/QueryByExamplePolicy.html#excludeDefaultPrimitiveValues--">excludeDefaultPrimitiveValues</a></span>()</code>
<div class="block">PUBLIC:
Ignores attributes set to the default value for their primitive type.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/eclipse/persistence/queries/QueryByExamplePolicy.html#excludeValue-boolean-">excludeValue</a></span>(boolean&nbsp;value)</code>
<div class="block">PUBLIC:
An attribute in the example object set to an excluded value will be
ignored in a Query By Example.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/eclipse/persistence/queries/QueryByExamplePolicy.html#excludeValue-byte-">excludeValue</a></span>(byte&nbsp;value)</code>
<div class="block">PUBLIC:
An attribute in the example object set to an excluded value will be
ignored in a Query By Example.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/eclipse/persistence/queries/QueryByExamplePolicy.html#excludeValue-char-">excludeValue</a></span>(char&nbsp;value)</code>
<div class="block">PUBLIC:
An attribute in the example object set to an excluded value will be
ignored in a Query By Example.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/eclipse/persistence/queries/QueryByExamplePolicy.html#excludeValue-double-">excludeValue</a></span>(double&nbsp;value)</code>
<div class="block">PUBLIC:
An attribute in the example object set to an excluded value will be
ignored in a Query By Example.</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/eclipse/persistence/queries/QueryByExamplePolicy.html#excludeValue-float-">excludeValue</a></span>(float&nbsp;value)</code>
<div class="block">PUBLIC:
An attribute in the example object set to an excluded value will be
ignored in a Query By Example.</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/eclipse/persistence/queries/QueryByExamplePolicy.html#excludeValue-int-">excludeValue</a></span>(int&nbsp;value)</code>
<div class="block">PUBLIC:
An attribute in the example object set to be an excluded value will be
ignored in a Query By Example.</div>
</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/eclipse/persistence/queries/QueryByExamplePolicy.html#excludeValue-long-">excludeValue</a></span>(long&nbsp;value)</code>
<div class="block">PUBLIC:
An attribute in the example object set to an excluded value will be
ignored in a Query By Example.</div>
</td>
</tr>
<tr id="i12" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/eclipse/persistence/queries/QueryByExamplePolicy.html#excludeValue-java.lang.Object-">excludeValue</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;value)</code>
<div class="block">PUBLIC:
An attribute in the example object set to an excluded value will be
ignored in a Query By Example.</div>
</td>
</tr>
<tr id="i13" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/eclipse/persistence/queries/QueryByExamplePolicy.html#excludeValue-short-">excludeValue</a></span>(short&nbsp;value)</code>
<div class="block">PUBLIC:
An attribute in the example object set to an excluded value will be
ignored in a Query By Example.</div>
</td>
</tr>
<tr id="i14" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/eclipse/persistence/queries/QueryByExamplePolicy.html#getAttributesToAlwaysInclude--">getAttributesToAlwaysInclude</a></span>()</code>
<div class="block">PUBLIC:
Attributes to always consider even if set to <code>null</code> or an excluded
value like <code>0</code> or <code>false</code>.</div>
</td>
</tr>
<tr id="i15" class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/eclipse/persistence/queries/QueryByExamplePolicy.html#getOperation-java.lang.Class-">getOperation</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a>&nbsp;aClass)</code>
<div class="block">INTERNAL:
determines which operation to use for comparison.</div>
</td>
</tr>
<tr id="i16" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/eclipse/persistence/queries/QueryByExamplePolicy.html#getSpecialOperations--">getSpecialOperations</a></span>()</code>
<div class="block">PUBLIC:
The special operations to use in place of <code>equal</code>.</div>
</td>
</tr>
<tr id="i17" class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/eclipse/persistence/queries/QueryByExamplePolicy.html#getValuesToExclude--">getValuesToExclude</a></span>()</code>
<div class="block">PUBLIC:
Decides which attributes to ignore based on the values they are set to.</div>
</td>
</tr>
<tr id="i18" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/eclipse/persistence/queries/QueryByExamplePolicy.html#includeAllValues--">includeAllValues</a></span>()</code>
<div class="block">PUBLIC:
Considers all mapped attributes in the example object as meaningful in a
Query By Example.</div>
</td>
</tr>
<tr id="i19" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/eclipse/persistence/queries/QueryByExamplePolicy.html#isAlwaysIncluded-java.lang.Class-java.lang.String-">isAlwaysIncluded</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a>&nbsp;theClass,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;attributeName)</code>
<div class="block">INTERNAL:
returns whether the attributeName is to be always included.</div>
</td>
</tr>
<tr id="i20" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/eclipse/persistence/queries/QueryByExamplePolicy.html#isExcludedValue-java.lang.Object-">isExcludedValue</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;value)</code>
<div class="block">INTERNAL:
returns if the value is in the values to be excluded automatically.</div>
</td>
</tr>
<tr id="i21" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/eclipse/persistence/queries/QueryByExamplePolicy.html#removeFromValuesToExclude-java.lang.Object-">removeFromValuesToExclude</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;value)</code>
<div class="block">PUBLIC:
Considers all attributes set to a previously excluded value on the example object.</div>
</td>
</tr>
<tr id="i22" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/eclipse/persistence/queries/QueryByExamplePolicy.html#setAttributesToAlwaysInclude-java.util.Map-">setAttributesToAlwaysInclude</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&nbsp;newAttributesToAlwaysInclude)</code>
<div class="block">INTERNAL:
It is possible to generate a Hashtable (keys are the Class, and values the attribute names)
of the attributes to be included at all times (even if the value is null, or the value
belongs to the values to be excluced automatically).</div>
</td>
</tr>
<tr id="i23" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/eclipse/persistence/queries/QueryByExamplePolicy.html#setShouldUseEqualityForNulls-boolean-">setShouldUseEqualityForNulls</a></span>(boolean&nbsp;shouldUseEqualityForNulls)</code>
<div class="block">PUBLIC:
Matches an included <code>null</code> attribute in the example object
either to objects with that attribute also set to <code>null</code> or to any
value other than <code>null</code>.</div>
</td>
</tr>
<tr id="i24" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/eclipse/persistence/queries/QueryByExamplePolicy.html#setSpecialOperations-java.util.Map-">setSpecialOperations</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&nbsp;newOperations)</code>
<div class="block">PUBLIC:
The special operations to use in place of <code>equal</code>.</div>
</td>
</tr>
<tr id="i25" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/eclipse/persistence/queries/QueryByExamplePolicy.html#setValidateExample-boolean-">setValidateExample</a></span>(boolean&nbsp;validate)</code>
<div class="block">PUBLIC:
When set to <code>true</code> the example object will be validated for unsupported mapping types.</div>
</td>
</tr>
<tr id="i26" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/eclipse/persistence/queries/QueryByExamplePolicy.html#setValuesToExclude-java.util.Map-">setValuesToExclude</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&nbsp;newValuesToExclude)</code>
<div class="block">PUBLIC:
Decides which attributes to ignore based on the values they are set to.</div>
</td>
</tr>
<tr id="i27" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/eclipse/persistence/queries/QueryByExamplePolicy.html#shouldIncludeInQuery-java.lang.Class-java.lang.String-java.lang.Object-">shouldIncludeInQuery</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a>&nbsp;aClass,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;attributeName,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;attributeValue)</code>
<div class="block">INTERNAL:
This method determines whether an attribute pair is be included in the query.</div>
</td>
</tr>
<tr id="i28" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/eclipse/persistence/queries/QueryByExamplePolicy.html#shouldUseEqualityForNulls--">shouldUseEqualityForNulls</a></span>()</code>
<div class="block">PUBLIC:
Matches an included <code>null</code> attribute in the example object
either to objects with that attribute also set to <code>null</code> or to any
value other than <code>null</code>.</div>
</td>
</tr>
<tr id="i29" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/eclipse/persistence/queries/QueryByExamplePolicy.html#shouldValidateExample--">shouldValidateExample</a></span>()</code>
<div class="block">PUBLIC:
Returns true if the example object used with this policy should be validated for attributes
with unsupported mappings.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang">clone</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.lang">equals</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang">finalize</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang">hashCode</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang">toString</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.detail">
<!-- -->
</a>
<h3>Field Detail</h3>
<a name="valuesToExclude">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>valuesToExclude</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a> valuesToExclude</pre>
</li>
</ul>
<a name="attributesToAlwaysInclude">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>attributesToAlwaysInclude</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a> attributesToAlwaysInclude</pre>
</li>
</ul>
<a name="specialOperations">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>specialOperations</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a> specialOperations</pre>
</li>
</ul>
<a name="shouldUseEqualityForNulls">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>shouldUseEqualityForNulls</h4>
<pre>public&nbsp;boolean shouldUseEqualityForNulls</pre>
</li>
</ul>
<a name="validateExample">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>validateExample</h4>
<pre>protected&nbsp;boolean validateExample</pre>
</li>
</ul>
</li>
</ul>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="QueryByExamplePolicy--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>QueryByExamplePolicy</h4>
<pre>public&nbsp;QueryByExamplePolicy()</pre>
<div class="block">PUBLIC:
Constructs a default policy equal to that used when no policy is specified.
<p>
Sets the default values to be excluded,
(that includes 0, false, empty String, etc).<p>
By default if an attribute is <code>null</code>, and yet has to be included at all times, equality (<code>isNull</code>)
is used for the comparison. This is used for searching for an object with a <code>null</code> in a certain field.</div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../org/eclipse/persistence/queries/QueryByExamplePolicy.html#excludeDefaultPrimitiveValues--"><code>excludeDefaultPrimitiveValues()</code></a>,
<a href="../../../../org/eclipse/persistence/queries/QueryByExamplePolicy.html#setShouldUseEqualityForNulls-boolean-"><code>setShouldUseEqualityForNulls(true)</code></a></dd>
</dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="addSpecialOperation-java.lang.Class-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addSpecialOperation</h4>
<pre>public&nbsp;void&nbsp;addSpecialOperation(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a>&nbsp;attributeValueClass,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;operation)</pre>
<div class="block">PUBLIC:
Allows operations other than <code>Expression.equal</code> to be used
for comparisons.
<p>
For example if an attribute of type <code>int</code> is
set to <code>x</code> in the example object, normally the query will be on all objects
whose attributes are also equal to <code>x</code>. The query could however be all
objects whose attributes are not <code>x</code>, greater than <code>x</code>, or even less than or
equal to <code>x</code>.
<p>
Any comparison operation in <a href="../../../../org/eclipse/persistence/expressions/Expression.html" title="class in org.eclipse.persistence.expressions"><code>Expression</code></a> which takes the example attribute as a parameter
can be used. A list of supported operations is provided below.
<p>
Note: A special operation can not be used for attributes set to <code>null</code>. The only
options are <a href="../../../../org/eclipse/persistence/expressions/Expression.html#isNull--"><code>isNull</code></a> (default) and
<a href="../../../../org/eclipse/persistence/expressions/Expression.html#notNull--"><code>notNull</code></a>. See
<a href="../../../../org/eclipse/persistence/queries/QueryByExamplePolicy.html#setShouldUseEqualityForNulls-boolean-"><code>setShouldUseEqualityForNulls(boolean)</code></a>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>attributeValueClass</code> - Attribute values of which type, for instance
<code>Integer</code>, to apply to. Note for <code>int</code> attributes the
class is <code>Integer.class</code> not <code>int.class</code>. This is not
the <code>Class</code> of the example object the attribute is an instance variable of.</dd>
<dd><code>operation</code> - Name of method in <code>Expression</code> used</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../org/eclipse/persistence/expressions/Expression.html#equal-byte-"><code>equal (default)</code></a>,
<a href="../../../../org/eclipse/persistence/expressions/Expression.html#notEqual-byte-"><code>notEqual</code></a>,
<a href="../../../../org/eclipse/persistence/expressions/Expression.html#equalsIgnoreCase-java.lang.String-"><code>equalsIgnoreCase</code></a>,
<a href="../../../../org/eclipse/persistence/expressions/Expression.html#lessThan-byte-"><code>lessThan</code></a>,
<a href="../../../../org/eclipse/persistence/expressions/Expression.html#lessThanEqual-byte-"><code>lessThanEqual</code></a>,
<a href="../../../../org/eclipse/persistence/expressions/Expression.html#greaterThan-byte-"><code>greaterThan</code></a>,
<a href="../../../../org/eclipse/persistence/expressions/Expression.html#greaterThanEqual-byte-"><code>greaterThanEqual</code></a>,
<a href="../../../../org/eclipse/persistence/expressions/Expression.html#like-java.lang.String-"><code>like</code></a>,
<a href="../../../../org/eclipse/persistence/expressions/Expression.html#likeIgnoreCase-java.lang.String-"><code>likeIgnoreCase</code></a>,
<a href="../../../../org/eclipse/persistence/expressions/Expression.html#containsAllKeyWords-java.lang.String-"><code>containsAllKeyWords</code></a>,
<a href="../../../../org/eclipse/persistence/expressions/Expression.html#containsAnyKeyWords-java.lang.String-"><code>containsAnyKeyWords</code></a>,
<a href="../../../../org/eclipse/persistence/expressions/Expression.html#containsSubstring-java.lang.String-"><code>containsSubstring</code></a>,
<a href="../../../../org/eclipse/persistence/expressions/Expression.html#containsSubstringIgnoringCase-java.lang.String-"><code>containsSubstringIgnoringCase</code></a></dd>
</dl>
</li>
</ul>
<a name="alwaysIncludeAttribute-java.lang.Class-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>alwaysIncludeAttribute</h4>
<pre>public&nbsp;void&nbsp;alwaysIncludeAttribute(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a>&nbsp;exampleClass,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;attributeName)</pre>
<div class="block">PUBLIC:
Always considers the value for a particular attribute as meaningful in a
query by example.
<p>
Required to override the normal behavior which is to ignore an
attribute of the example object if set to <code>null</code>, or an excluded value
like <code>0</code>.
<p>
Example: To find all projects without a budget set <code>budget</code> to 0 in the
example object and call <code>alwaysIncludeAttribute(Project.class, "budget")</code>
on the policy.
<p></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>exampleClass</code> - The class that the attribute belongs to, normally this is the example class unless using nested QBE.</dd>
<dd><code>attributeName</code> - The name of a mapped attribute.</dd>
</dl>
</li>
</ul>
<a name="completeExpression-org.eclipse.persistence.expressions.Expression-java.lang.Object-java.lang.Class-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>completeExpression</h4>
<pre>public&nbsp;<a href="../../../../org/eclipse/persistence/expressions/Expression.html" title="class in org.eclipse.persistence.expressions">Expression</a>&nbsp;completeExpression(<a href="../../../../org/eclipse/persistence/expressions/Expression.html" title="class in org.eclipse.persistence.expressions">Expression</a>&nbsp;expression,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;attributeValue,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a>&nbsp;attributeValueClass)</pre>
<div class="block">INTERNAL:
This method is used to determine which operation to use for comparison (equal, or a special operation).</div>
</li>
</ul>
<a name="completeExpressionForNull-org.eclipse.persistence.expressions.Expression-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>completeExpressionForNull</h4>
<pre>public&nbsp;<a href="../../../../org/eclipse/persistence/expressions/Expression.html" title="class in org.eclipse.persistence.expressions">Expression</a>&nbsp;completeExpressionForNull(<a href="../../../../org/eclipse/persistence/expressions/Expression.html" title="class in org.eclipse.persistence.expressions">Expression</a>&nbsp;expression)</pre>
<div class="block">INTERNAL:
This method is used when the attribute value is null, but it has
to be included at all times. It determines whether to use isNull, or notNull.</div>
</li>
</ul>
<a name="excludeDefaultPrimitiveValues--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>excludeDefaultPrimitiveValues</h4>
<pre>public&nbsp;void&nbsp;excludeDefaultPrimitiveValues()</pre>
<div class="block">PUBLIC:
Ignores attributes set to the default value for their primitive type.
<p>
For instance <code>0</code> is used as <code>null</code> for deciding
which <code>int</code> attributes of the example object can be ignored in a
query by example.
<p>
Called by the constructor.</div>
</li>
</ul>
<a name="excludeValue-byte-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>excludeValue</h4>
<pre>public&nbsp;void&nbsp;excludeValue(byte&nbsp;value)</pre>
<div class="block">PUBLIC:
An attribute in the example object set to an excluded value will be
ignored in a Query By Example.<p>
The default excluded value for <code>byte</code> is <code>0</code>.</div>
</li>
</ul>
<a name="excludeValue-char-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>excludeValue</h4>
<pre>public&nbsp;void&nbsp;excludeValue(char&nbsp;value)</pre>
<div class="block">PUBLIC:
An attribute in the example object set to an excluded value will be
ignored in a Query By Example.<p>
The default excluded value for <code>char</code> is <code>'�'</code>.</div>
</li>
</ul>
<a name="excludeValue-double-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>excludeValue</h4>
<pre>public&nbsp;void&nbsp;excludeValue(double&nbsp;value)</pre>
<div class="block">PUBLIC:
An attribute in the example object set to an excluded value will be
ignored in a Query By Example.<p>
The default excluded value for <code>double</code> is <code>0.0</code>.</div>
</li>
</ul>
<a name="excludeValue-float-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>excludeValue</h4>
<pre>public&nbsp;void&nbsp;excludeValue(float&nbsp;value)</pre>
<div class="block">PUBLIC:
An attribute in the example object set to an excluded value will be
ignored in a Query By Example.<p>
The default excluded value for <code>float</code> is <code>0.0f</code>.</div>
</li>
</ul>
<a name="excludeValue-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>excludeValue</h4>
<pre>public&nbsp;void&nbsp;excludeValue(int&nbsp;value)</pre>
<div class="block">PUBLIC:
An attribute in the example object set to be an excluded value will be
ignored in a Query By Example.<p>
The default excluded value for <code>int</code> is <code>0</code>.</div>
</li>
</ul>
<a name="excludeValue-long-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>excludeValue</h4>
<pre>public&nbsp;void&nbsp;excludeValue(long&nbsp;value)</pre>
<div class="block">PUBLIC:
An attribute in the example object set to an excluded value will be
ignored in a Query By Example.<p>
The default excluded value for <code>long</code> is <code>0</code>.</div>
</li>
</ul>
<a name="excludeValue-java.lang.Object-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>excludeValue</h4>
<pre>public&nbsp;void&nbsp;excludeValue(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;value)</pre>
<div class="block">PUBLIC:
An attribute in the example object set to an excluded value will be
ignored in a Query By Example.<p>
The default excluded value for <code>String</code> is <code>""</code>.<p>
Note: <code>null</code> is special and always considered an excluded value.</div>
</li>
</ul>
<a name="excludeValue-short-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>excludeValue</h4>
<pre>public&nbsp;void&nbsp;excludeValue(short&nbsp;value)</pre>
<div class="block">PUBLIC:
An attribute in the example object set to an excluded value will be
ignored in a Query By Example.<p>
The default excluded value for <code>short</code> is <code>0</code>.</div>
</li>
</ul>
<a name="excludeValue-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>excludeValue</h4>
<pre>public&nbsp;void&nbsp;excludeValue(boolean&nbsp;value)</pre>
<div class="block">PUBLIC:
An attribute in the example object set to an excluded value will be
ignored in a Query By Example.<p>
The default excluded value for <code>boolean</code> is <code>false</code>.</div>
</li>
</ul>
<a name="getAttributesToAlwaysInclude--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getAttributesToAlwaysInclude</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&nbsp;getAttributesToAlwaysInclude()</pre>
<div class="block">PUBLIC:
Attributes to always consider even if set to <code>null</code> or an excluded
value like <code>0</code> or <code>false</code>.</div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../org/eclipse/persistence/queries/QueryByExamplePolicy.html#alwaysIncludeAttribute-java.lang.Class-java.lang.String-"><code>alwaysIncludeAttribute(java.lang.Class, java.lang.String)</code></a></dd>
</dl>
</li>
</ul>
<a name="getOperation-java.lang.Class-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getOperation</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;getOperation(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a>&nbsp;aClass)</pre>
<div class="block">INTERNAL:
determines which operation to use for comparison.</div>
</li>
</ul>
<a name="getSpecialOperations--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getSpecialOperations</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&nbsp;getSpecialOperations()</pre>
<div class="block">PUBLIC:
The special operations to use in place of <code>equal</code>.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>A hashtable where the keys are <code>Class</code> objects and the values
are the names of operations to use for attributes of that <code>Class</code>.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../org/eclipse/persistence/queries/QueryByExamplePolicy.html#addSpecialOperation-java.lang.Class-java.lang.String-"><code>addSpecialOperation(java.lang.Class, java.lang.String)</code></a></dd>
</dl>
</li>
</ul>
<a name="getValuesToExclude--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getValuesToExclude</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&nbsp;getValuesToExclude()</pre>
<div class="block">PUBLIC:
Decides which attributes to ignore based on the values they are set to.
<p>
If an attribute of the example domain object is set to one of these values it will
be ignored, and not considered in the query.
<p>
Attributes set to excluded values are not always ignored.
See <a href="../../../../org/eclipse/persistence/queries/QueryByExamplePolicy.html#alwaysIncludeAttribute-java.lang.Class-java.lang.String-"><code>alwaysIncludeAttribute</code></a>.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>valuesToExclude The keys and values are values to exclude (key == value). Primitives are
wrapped, so <code>int 0</code> will be stored as <code>Integer(0)</code>.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../org/eclipse/persistence/queries/QueryByExamplePolicy.html#excludeValue-byte-"><code>excludeValue(byte)</code></a>,
<a href="../../../../org/eclipse/persistence/queries/QueryByExamplePolicy.html#excludeDefaultPrimitiveValues--"><code>excludeDefaultPrimitiveValues()</code></a>,
<a href="../../../../org/eclipse/persistence/queries/QueryByExamplePolicy.html#includeAllValues--"><code>includeAllValues()</code></a></dd>
</dl>
</li>
</ul>
<a name="includeAllValues--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>includeAllValues</h4>
<pre>public&nbsp;void&nbsp;includeAllValues()</pre>
<div class="block">PUBLIC:
Considers all mapped attributes in the example object as meaningful in a
Query By Example.<p>
Note: Even attributes of the example object that are
not set, and therefore zero or empty by default, will be included.<p>
Reverses a previous call to <a href="../../../../org/eclipse/persistence/queries/QueryByExamplePolicy.html#excludeDefaultPrimitiveValues--"><code>excludeDefaultPrimitiveValues()</code></a>.</div>
</li>
</ul>
<a name="isAlwaysIncluded-java.lang.Class-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isAlwaysIncluded</h4>
<pre>public&nbsp;boolean&nbsp;isAlwaysIncluded(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a>&nbsp;theClass,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;attributeName)</pre>
<div class="block">INTERNAL:
returns whether the attributeName is to be always included.</div>
</li>
</ul>
<a name="isExcludedValue-java.lang.Object-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isExcludedValue</h4>
<pre>public&nbsp;boolean&nbsp;isExcludedValue(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;value)</pre>
<div class="block">INTERNAL:
returns if the value is in the values to be excluded automatically.</div>
</li>
</ul>
<a name="removeFromValuesToExclude-java.lang.Object-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>removeFromValuesToExclude</h4>
<pre>public&nbsp;void&nbsp;removeFromValuesToExclude(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;value)</pre>
<div class="block">PUBLIC:
Considers all attributes set to a previously excluded value on the example object.
<p>
Primitive values to be removed must first be wrapped inside an Object.
<p></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>value</code> - No attributes set to <code>value</code> will be excluded from a Query By Example.
<code>value.getClass()</code> is a key of the Hashtable returned by <a href="../../../../org/eclipse/persistence/queries/QueryByExamplePolicy.html#getValuesToExclude--"><code>getValuesToExclude()</code></a>.
<p>Note: There is a distinction between an attribute and the value
it is set to. An attribute can be included independently of its value with
<a href="../../../../org/eclipse/persistence/queries/QueryByExamplePolicy.html#alwaysIncludeAttribute-java.lang.Class-java.lang.String-"><code>alwaysIncludeAttribute</code></a> (recommended). It can also be included
by making the value it is set to no longer excluded.
<p>Note: <code>null</code> values are special and will always be excluded.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../org/eclipse/persistence/queries/QueryByExamplePolicy.html#excludeDefaultPrimitiveValues--"><code>excludeDefaultPrimitiveValues()</code></a>,
<a href="../../../../org/eclipse/persistence/queries/QueryByExamplePolicy.html#includeAllValues--"><code>includeAllValues()</code></a>,
<a href="../../../../org/eclipse/persistence/queries/QueryByExamplePolicy.html#excludeValue-java.lang.Object-"><code>excludeValue(Object)</code></a></dd>
</dl>
</li>
</ul>
<a name="setAttributesToAlwaysInclude-java.util.Map-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setAttributesToAlwaysInclude</h4>
<pre>public&nbsp;void&nbsp;setAttributesToAlwaysInclude(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&nbsp;newAttributesToAlwaysInclude)</pre>
<div class="block">INTERNAL:
It is possible to generate a Hashtable (keys are the Class, and values the attribute names)
of the attributes to be included at all times (even if the value is null, or the value
belongs to the values to be excluced automatically).</div>
</li>
</ul>
<a name="setShouldUseEqualityForNulls-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setShouldUseEqualityForNulls</h4>
<pre>public&nbsp;void&nbsp;setShouldUseEqualityForNulls(boolean&nbsp;shouldUseEqualityForNulls)</pre>
<div class="block">PUBLIC:
Matches an included <code>null</code> attribute in the example object
either to objects with that attribute also set to <code>null</code> or to any
value other than <code>null</code>.
<p>
Set to <code>false</code> to only select objects where certain attributes have been set.
<p>
Example: to find all Employees with an assigned <code>address</code>, set
attribute <code>address</code> to <code>null</code> in the example object,
call <code>alwaysIncludeAttribute(Employee.class, "address")</code> and then
call <code>setShouldUseEqualityForNulls(false)</code>.
<p>
Note: Unless an attribute set to <code>null</code> is specifically included, it
will not be considered at all in the Query By Example.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>shouldUseEqualityForNulls</code> - If true (by default) uses <code>isNull</code> else <code>notNull</code>.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../org/eclipse/persistence/queries/QueryByExamplePolicy.html#addSpecialOperation-java.lang.Class-java.lang.String-"><code>addSpecialOperation</code></a>,
<a href="../../../../org/eclipse/persistence/queries/QueryByExamplePolicy.html#alwaysIncludeAttribute-java.lang.Class-java.lang.String-"><code>alwaysIncludeAttribute</code></a></dd>
</dl>
</li>
</ul>
<a name="setSpecialOperations-java.util.Map-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setSpecialOperations</h4>
<pre>public&nbsp;void&nbsp;setSpecialOperations(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&nbsp;newOperations)</pre>
<div class="block">PUBLIC:
The special operations to use in place of <code>equal</code>.<p></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>newOperations</code> - A hashtable where the keys are <code>Class</code> objects and the values
are the names of operations to use for attributes of that <code>Class</code>.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../org/eclipse/persistence/queries/QueryByExamplePolicy.html#addSpecialOperation-java.lang.Class-java.lang.String-"><code>addSpecialOperation(java.lang.Class, java.lang.String)</code></a></dd>
</dl>
</li>
</ul>
<a name="setValidateExample-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setValidateExample</h4>
<pre>public&nbsp;void&nbsp;setValidateExample(boolean&nbsp;validate)</pre>
<div class="block">PUBLIC:
When set to <code>true</code> the example object will be validated for unsupported mapping types.
If you wish these mapping types to be ignored either set this flag to <code>false</code> or add the attribute
to the list of ignored attributes in this policy</div>
</li>
</ul>
<a name="setValuesToExclude-java.util.Map-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setValuesToExclude</h4>
<pre>public&nbsp;void&nbsp;setValuesToExclude(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&nbsp;newValuesToExclude)</pre>
<div class="block">PUBLIC:
Decides which attributes to ignore based on the values they are set to.
<p>
An attribute of the example domain object set to one of these values will
be ignored, and not considered in the query.
<p>
Attributes set to excluded values are not always ignored.
See <a href="../../../../org/eclipse/persistence/queries/QueryByExamplePolicy.html#alwaysIncludeAttribute-java.lang.Class-java.lang.String-"><code>alwaysIncludeAttribute</code></a>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>newValuesToExclude</code> - The keys and values are values to exclude (key == value). Primitives are
wrapped, so <code>int 0</code> will be stored as <code>Integer(0)</code>.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../org/eclipse/persistence/queries/QueryByExamplePolicy.html#excludeValue-byte-"><code>excludeValue(byte)</code></a>,
<a href="../../../../org/eclipse/persistence/queries/QueryByExamplePolicy.html#excludeDefaultPrimitiveValues--"><code>excludeDefaultPrimitiveValues()</code></a>,
<a href="../../../../org/eclipse/persistence/queries/QueryByExamplePolicy.html#includeAllValues--"><code>includeAllValues()</code></a></dd>
</dl>
</li>
</ul>
<a name="shouldIncludeInQuery-java.lang.Class-java.lang.String-java.lang.Object-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>shouldIncludeInQuery</h4>
<pre>public&nbsp;boolean&nbsp;shouldIncludeInQuery(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a>&nbsp;aClass,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;attributeName,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;attributeValue)</pre>
<div class="block">INTERNAL:
This method determines whether an attribute pair is be included in the query.</div>
</li>
</ul>
<a name="shouldUseEqualityForNulls--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>shouldUseEqualityForNulls</h4>
<pre>public&nbsp;boolean&nbsp;shouldUseEqualityForNulls()</pre>
<div class="block">PUBLIC:
Matches an included <code>null</code> attribute in the example object
either to objects with that attribute also set to <code>null</code> or to any
value other than <code>null</code>.
<p>
Set to <code>false</code> to only select objects where certain attributes have been set.
<p>
Example: to find all Employees with an assigned <code>address</code>, set
attribute <code>address</code> to <code>null</code> in the example object,
call <code>alwaysIncludeAttribute(Employee.class, "address")</code> and then
call <code>setShouldUseEqualityForNulls(false)</code>.
<p></div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>If true (by default) uses <code>isNull</code> else <code>notNull</code>.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../org/eclipse/persistence/queries/QueryByExamplePolicy.html#addSpecialOperation-java.lang.Class-java.lang.String-"><code>addSpecialOperation</code></a>,
<a href="../../../../org/eclipse/persistence/queries/QueryByExamplePolicy.html#alwaysIncludeAttribute-java.lang.Class-java.lang.String-"><code>alwaysIncludeAttribute</code></a></dd>
</dl>
</li>
</ul>
<a name="shouldValidateExample--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>shouldValidateExample</h4>
<pre>public&nbsp;boolean&nbsp;shouldValidateExample()</pre>
<div class="block">PUBLIC:
Returns true if the example object used with this policy should be validated for attributes
with unsupported mappings.</div>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage">EclipseLink 3.0.1, API Reference</div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/eclipse/persistence/queries/ObjectLevelReadQuery.html" title="class in org.eclipse.persistence.queries"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../org/eclipse/persistence/queries/QueryRedirector.html" title="interface in org.eclipse.persistence.queries"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/eclipse/persistence/queries/QueryByExamplePolicy.html" target="_top">Frames</a></li>
<li><a href="QueryByExamplePolicy.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright &#169; 2007&#x2013;2021 <a href="http://www.eclipse.org/eclipselink">Eclipse.org - EclipseLink Project</a>. All rights reserved.</small></p>
</body>
</html>