blob: d63a18c9ab3d479b8dd5fc3379695dab362ab454 [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 (version 1.7.0_67) on Sat Sep 20 17:22:57 FET 2014 -->
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>ObjectContext (Cayenne Documentation 3.1 API)</title>
<meta name="date" content="2014-09-20">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="ObjectContext (Cayenne Documentation 3.1 API)";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><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="class-use/ObjectContext.html">Use</a></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>
<div class="subNav">
<ul class="navList">
<li><a href="../../../org/apache/cayenne/LifecycleListener.html" title="interface in org.apache.cayenne"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../org/apache/cayenne/ObjectId.html" title="class in org.apache.cayenne"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?org/apache/cayenne/ObjectContext.html" target="_top">Frames</a></li>
<li><a href="ObjectContext.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../allclasses-noframe.html">All 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>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&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.apache.cayenne</div>
<h2 title="Interface ObjectContext" class="title">Interface ObjectContext</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Superinterfaces:</dt>
<dd><a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</a></dd>
</dl>
<dl>
<dt>All Known Implementing Classes:</dt>
<dd><a href="../../../org/apache/cayenne/BaseContext.html" title="class in org.apache.cayenne">BaseContext</a>, <a href="../../../org/apache/cayenne/CayenneContext.html" title="class in org.apache.cayenne">CayenneContext</a>, <a href="../../../org/apache/cayenne/access/DataContext.html" title="class in org.apache.cayenne.access">DataContext</a></dd>
</dl>
<hr>
<br>
<pre>public interface <span class="strong">ObjectContext</span>
extends <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</a></pre>
<div class="block">A Cayenne object facade to a persistent store. Instances of ObjectContext are used in
the application code to access Cayenne persistence features.</div>
<dl><dt><span class="strong">Since:</span></dt>
<dd>1.2</dd></dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../org/apache/cayenne/ObjectContext.html#commitChanges()">commitChanges</a></strong>()</code>
<div class="block">Flushes all changes to objects in this context to the parent DataChannel, cascading
flush operation all the way through the stack, ultimately saving data in the
database.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../org/apache/cayenne/ObjectContext.html#commitChangesToParent()">commitChangesToParent</a></strong>()</code>
<div class="block">Flushes all changes to objects in this context to the parent DataChannel.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../org/apache/cayenne/ObjectContext.html" title="interface in org.apache.cayenne">ObjectContext</a></code></td>
<td class="colLast"><code><strong><a href="../../../org/apache/cayenne/ObjectContext.html#createChildContext()">createChildContext</a></strong>()</code>
<div class="block"><strong>Deprecated.</strong>&nbsp;
<div class="block"><i>Since 3.1 replaced by <a href="../../../org/apache/cayenne/configuration/CayenneRuntime.html#getContext(org.apache.cayenne.DataChannel)"><code>CayenneRuntime.getContext(DataChannel)</code></a></i></div>
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;?&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../org/apache/cayenne/ObjectContext.html#deletedObjects()">deletedObjects</a></strong>()</code>
<div class="block">Returns a collection of objects that are registered with this ObjectContext and
have a state PersistenceState.DELETED</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../org/apache/cayenne/ObjectContext.html#deleteObject(java.lang.Object)">deleteObject</a></strong>(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;object)</code>
<div class="block">Schedules a persistent object for deletion on next commit.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../org/apache/cayenne/ObjectContext.html#deleteObjects(java.util.Collection)">deleteObjects</a></strong>(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;?&gt;&nbsp;objects)</code>
<div class="block">Schedules deletion of a collection of persistent objects.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>&lt;T&gt;&nbsp;void</code></td>
<td class="colLast"><code><strong><a href="../../../org/apache/cayenne/ObjectContext.html#deleteObjects(T...)">deleteObjects</a></strong>(T...&nbsp;objects)</code>
<div class="block">Schedules deletion of one or more persistent objects.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../org/apache/cayenne/DataChannel.html" title="interface in org.apache.cayenne">DataChannel</a></code></td>
<td class="colLast"><code><strong><a href="../../../org/apache/cayenne/ObjectContext.html#getChannel()">getChannel</a></strong>()</code>
<div class="block">Returns an DataChannel used by this context.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../org/apache/cayenne/map/EntityResolver.html" title="class in org.apache.cayenne.map">EntityResolver</a></code></td>
<td class="colLast"><code><strong><a href="../../../org/apache/cayenne/ObjectContext.html#getEntityResolver()">getEntityResolver</a></strong>()</code>
<div class="block">Returns EntityResolver that stores all mapping information accessible by this
ObjectContext.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../org/apache/cayenne/graph/GraphManager.html" title="interface in org.apache.cayenne.graph">GraphManager</a></code></td>
<td class="colLast"><code><strong><a href="../../../org/apache/cayenne/ObjectContext.html#getGraphManager()">getGraphManager</a></strong>()</code>
<div class="block">Returns GraphManager that manages object graph associated with this context.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></td>
<td class="colLast"><code><strong><a href="../../../org/apache/cayenne/ObjectContext.html#getUserProperty(java.lang.String)">getUserProperty</a></strong>(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;key)</code>
<div class="block">Returns a user-defined property previously set via 'setUserProperty'.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../org/apache/cayenne/ObjectContext.html#hasChanges()">hasChanges</a></strong>()</code>
<div class="block">Returns <code>true</code> if there are any modified, deleted or new objects
registered with this ObjectContext, <code>false</code> otherwise.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../org/apache/cayenne/ObjectContext.html#invalidateObjects(java.util.Collection)">invalidateObjects</a></strong>(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;?&gt;&nbsp;objects)</code>
<div class="block">Invalidates a Collection of persistent objects.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>&lt;T&gt;&nbsp;void</code></td>
<td class="colLast"><code><strong><a href="../../../org/apache/cayenne/ObjectContext.html#invalidateObjects(T...)">invalidateObjects</a></strong>(T...&nbsp;objects)</code>
<div class="block">Invalidates one or more persistent objects.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../org/apache/cayenne/Persistent.html" title="interface in org.apache.cayenne">Persistent</a></code></td>
<td class="colLast"><code><strong><a href="../../../org/apache/cayenne/ObjectContext.html#localObject(org.apache.cayenne.ObjectId,%20java.lang.Object)">localObject</a></strong>(<a href="../../../org/apache/cayenne/ObjectId.html" title="class in org.apache.cayenne">ObjectId</a>&nbsp;id,
<a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;prototype)</code>
<div class="block"><strong>Deprecated.</strong>&nbsp;
<div class="block"><i>since 3.1 Cayenne users should use <a href="../../../org/apache/cayenne/ObjectContext.html#localObject(T)"><code>localObject(Object)</code></a>; the
internal code has been refactored to avoid using this method all
together.</i></div>
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>&lt;T&gt;&nbsp;T</code></td>
<td class="colLast"><code><strong><a href="../../../org/apache/cayenne/ObjectContext.html#localObject(T)">localObject</a></strong>(T&nbsp;objectFromAnotherContext)</code>
<div class="block">Returns a local copy of 'objectFromAnotherContext' object.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;?&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../org/apache/cayenne/ObjectContext.html#modifiedObjects()">modifiedObjects</a></strong>()</code>
<div class="block">Returns a collection of objects that are registered with this ObjectContext and
have a state PersistenceState.MODIFIED</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>&lt;T&gt;&nbsp;T</code></td>
<td class="colLast"><code><strong><a href="../../../org/apache/cayenne/ObjectContext.html#newObject(java.lang.Class)">newObject</a></strong>(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a>&lt;T&gt;&nbsp;persistentClass)</code>
<div class="block">Creates a new persistent object of a given class scheduled to be inserted to the
database on next commit.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;?&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../org/apache/cayenne/ObjectContext.html#newObjects()">newObjects</a></strong>()</code>
<div class="block">Returns a collection of objects that are registered with this ObjectContext and
have a state PersistenceState.NEW</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../org/apache/cayenne/QueryResponse.html" title="interface in org.apache.cayenne">QueryResponse</a></code></td>
<td class="colLast"><code><strong><a href="../../../org/apache/cayenne/ObjectContext.html#performGenericQuery(org.apache.cayenne.query.Query)">performGenericQuery</a></strong>(<a href="../../../org/apache/cayenne/query/Query.html" title="interface in org.apache.cayenne.query">Query</a>&nbsp;query)</code>
<div class="block">Executes any kind of query providing the result in a form of QueryResponse.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a></code></td>
<td class="colLast"><code><strong><a href="../../../org/apache/cayenne/ObjectContext.html#performQuery(org.apache.cayenne.query.Query)">performQuery</a></strong>(<a href="../../../org/apache/cayenne/query/Query.html" title="interface in org.apache.cayenne.query">Query</a>&nbsp;query)</code>
<div class="block">Executes a selecting query, returning a list of persistent objects or data rows.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../org/apache/cayenne/ObjectContext.html#prepareForAccess(org.apache.cayenne.Persistent,%20java.lang.String,%20boolean)">prepareForAccess</a></strong>(<a href="../../../org/apache/cayenne/Persistent.html" title="interface in org.apache.cayenne">Persistent</a>&nbsp;object,
<a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;property,
boolean&nbsp;lazyFaulting)</code>
<div class="block">A callback method that child Persistent objects are expected to call before
accessing property values.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../org/apache/cayenne/ObjectContext.html#propertyChanged(org.apache.cayenne.Persistent,%20java.lang.String,%20java.lang.Object,%20java.lang.Object)">propertyChanged</a></strong>(<a href="../../../org/apache/cayenne/Persistent.html" title="interface in org.apache.cayenne">Persistent</a>&nbsp;object,
<a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;property,
<a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;oldValue,
<a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;newValue)</code>
<div class="block">A callback method that child Persistent objects are expected to call from inside
the setter after modifying a value of a persistent property, including "simple" and
"arc" properties.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../org/apache/cayenne/ObjectContext.html#registerNewObject(java.lang.Object)">registerNewObject</a></strong>(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;object)</code>
<div class="block">Registers a transient object with the context.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../org/apache/cayenne/ObjectContext.html#rollbackChanges()">rollbackChanges</a></strong>()</code>
<div class="block">Resets all uncommitted changes made to the objects in this ObjectContext, cascading
rollback operation all the way through the stack.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../org/apache/cayenne/ObjectContext.html#rollbackChangesLocally()">rollbackChangesLocally</a></strong>()</code>
<div class="block">Resets all uncommitted changes made to the objects in this ObjectContext.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../org/apache/cayenne/ObjectContext.html#setUserProperty(java.lang.String,%20java.lang.Object)">setUserProperty</a></strong>(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;key,
<a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;value)</code>
<div class="block">Sets a user-defined property.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;?&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../org/apache/cayenne/ObjectContext.html#uncommittedObjects()">uncommittedObjects</a></strong>()</code>
<div class="block">Returns a collection of MODIFIED, DELETED or NEW objects.</div>
</td>
</tr>
</table>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="getEntityResolver()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getEntityResolver</h4>
<pre><a href="../../../org/apache/cayenne/map/EntityResolver.html" title="class in org.apache.cayenne.map">EntityResolver</a>&nbsp;getEntityResolver()</pre>
<div class="block">Returns EntityResolver that stores all mapping information accessible by this
ObjectContext.</div>
</li>
</ul>
<a name="newObjects()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>newObjects</h4>
<pre><a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;?&gt;&nbsp;newObjects()</pre>
<div class="block">Returns a collection of objects that are registered with this ObjectContext and
have a state PersistenceState.NEW</div>
</li>
</ul>
<a name="deletedObjects()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>deletedObjects</h4>
<pre><a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;?&gt;&nbsp;deletedObjects()</pre>
<div class="block">Returns a collection of objects that are registered with this ObjectContext and
have a state PersistenceState.DELETED</div>
</li>
</ul>
<a name="modifiedObjects()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>modifiedObjects</h4>
<pre><a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;?&gt;&nbsp;modifiedObjects()</pre>
<div class="block">Returns a collection of objects that are registered with this ObjectContext and
have a state PersistenceState.MODIFIED</div>
</li>
</ul>
<a name="uncommittedObjects()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>uncommittedObjects</h4>
<pre><a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;?&gt;&nbsp;uncommittedObjects()</pre>
<div class="block">Returns a collection of MODIFIED, DELETED or NEW objects.</div>
</li>
</ul>
<a name="localObject(org.apache.cayenne.ObjectId, java.lang.Object)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>localObject</h4>
<pre><a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang">@Deprecated</a>
<a href="../../../org/apache/cayenne/Persistent.html" title="interface in org.apache.cayenne">Persistent</a>&nbsp;localObject(<a href="../../../org/apache/cayenne/ObjectId.html" title="class in org.apache.cayenne">ObjectId</a>&nbsp;id,
<a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;prototype)</pre>
<div class="block"><span class="strong">Deprecated.</span>&nbsp;<i>since 3.1 Cayenne users should use <a href="../../../org/apache/cayenne/ObjectContext.html#localObject(T)"><code>localObject(Object)</code></a>; the
internal code has been refactored to avoid using this method all
together.</i></div>
<div class="block">Returns an object local to this ObjectContext and matching the ObjectId. If
<code>prototype</code> is not null, local object is refreshed with the prototype
values.
<p>
This method can do both "mapping" (i.e. finding an object with the same id in this
context) and "synchronization" (i.e. updating the state of the found object with
the state of the prototype object).
</p></div>
</li>
</ul>
<a name="localObject(java.lang.Object)">
<!-- -->
</a><a name="localObject(T)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>localObject</h4>
<pre>&lt;T&gt;&nbsp;T&nbsp;localObject(T&nbsp;objectFromAnotherContext)</pre>
<div class="block">Returns a local copy of 'objectFromAnotherContext' object. "Local" means that the
returned object is registered in this context. If the local object hasn't been
previously cached in this context, a hollow object is created and returned to the
caller. No DB query is performed to resolve an object.
<p>
Note that passing an object with a non-existing id, may later result in
FaultFailureException on attempt to read returned object properties.</div>
<dl><dt><span class="strong">Since:</span></dt>
<dd>3.1</dd></dl>
</li>
</ul>
<a name="newObject(java.lang.Class)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>newObject</h4>
<pre>&lt;T&gt;&nbsp;T&nbsp;newObject(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a>&lt;T&gt;&nbsp;persistentClass)</pre>
<div class="block">Creates a new persistent object of a given class scheduled to be inserted to the
database on next commit.</div>
</li>
</ul>
<a name="registerNewObject(java.lang.Object)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>registerNewObject</h4>
<pre>void&nbsp;registerNewObject(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;object)</pre>
<div class="block">Registers a transient object with the context. The difference with
<a href="../../../org/apache/cayenne/ObjectContext.html#newObject(java.lang.Class)"><code>newObject(Class)</code></a> is that a user creates an object herself, before
attaching it to the context, instead of relying on Cayenne to do that.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>object</code> - new object that needs to be made persistent.</dd><dt><span class="strong">Since:</span></dt>
<dd>3.0</dd></dl>
</li>
</ul>
<a name="deleteObject(java.lang.Object)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>deleteObject</h4>
<pre>void&nbsp;deleteObject(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;object)
throws <a href="../../../org/apache/cayenne/DeleteDenyException.html" title="class in org.apache.cayenne">DeleteDenyException</a></pre>
<div class="block">Schedules a persistent object for deletion on next commit.</div>
<dl><dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../org/apache/cayenne/DeleteDenyException.html" title="class in org.apache.cayenne">DeleteDenyException</a></code> - if a <a href="../../../org/apache/cayenne/map/DeleteRule.html#DENY"><code>DeleteRule.DENY</code></a>
delete rule is applicable for object deletion.</dd></dl>
</li>
</ul>
<a name="deleteObjects(java.util.Collection)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>deleteObjects</h4>
<pre>void&nbsp;deleteObjects(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;?&gt;&nbsp;objects)
throws <a href="../../../org/apache/cayenne/DeleteDenyException.html" title="class in org.apache.cayenne">DeleteDenyException</a></pre>
<div class="block">Schedules deletion of a collection of persistent objects.</div>
<dl><dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../org/apache/cayenne/DeleteDenyException.html" title="class in org.apache.cayenne">DeleteDenyException</a></code> - if a <a href="../../../org/apache/cayenne/map/DeleteRule.html#DENY"><code>DeleteRule.DENY</code></a>
delete rule is applicable for object deletion.</dd></dl>
</li>
</ul>
<a name="deleteObjects(java.lang.Object[])">
<!-- -->
</a><a name="deleteObjects(T...)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>deleteObjects</h4>
<pre>&lt;T&gt;&nbsp;void&nbsp;deleteObjects(T...&nbsp;objects)
throws <a href="../../../org/apache/cayenne/DeleteDenyException.html" title="class in org.apache.cayenne">DeleteDenyException</a></pre>
<div class="block">Schedules deletion of one or more persistent objects. Same as
<a href="../../../org/apache/cayenne/ObjectContext.html#deleteObjects(java.util.Collection)"><code>deleteObjects(Collection)</code></a> only with a vararg argument list for easier
deletion of individual objects.</div>
<dl><dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../org/apache/cayenne/DeleteDenyException.html" title="class in org.apache.cayenne">DeleteDenyException</a></code> - if a <a href="../../../org/apache/cayenne/map/DeleteRule.html#DENY"><code>DeleteRule.DENY</code></a>
delete rule is applicable for object deletion.</dd><dt><span class="strong">Since:</span></dt>
<dd>3.1</dd></dl>
</li>
</ul>
<a name="prepareForAccess(org.apache.cayenne.Persistent, java.lang.String, boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>prepareForAccess</h4>
<pre>void&nbsp;prepareForAccess(<a href="../../../org/apache/cayenne/Persistent.html" title="interface in org.apache.cayenne">Persistent</a>&nbsp;object,
<a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;property,
boolean&nbsp;lazyFaulting)</pre>
<div class="block">A callback method that child Persistent objects are expected to call before
accessing property values. This callback allows ObjectContext to "inflate"
unresolved objects on demand and also resolve properties that rely on lazy
faulting.</div>
<dl><dt><span class="strong">Since:</span></dt>
<dd>3.0</dd></dl>
</li>
</ul>
<a name="propertyChanged(org.apache.cayenne.Persistent, java.lang.String, java.lang.Object, java.lang.Object)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>propertyChanged</h4>
<pre>void&nbsp;propertyChanged(<a href="../../../org/apache/cayenne/Persistent.html" title="interface in org.apache.cayenne">Persistent</a>&nbsp;object,
<a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;property,
<a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;oldValue,
<a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;newValue)</pre>
<div class="block">A callback method that child Persistent objects are expected to call from inside
the setter after modifying a value of a persistent property, including "simple" and
"arc" properties.</div>
</li>
</ul>
<a name="commitChanges()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>commitChanges</h4>
<pre>void&nbsp;commitChanges()</pre>
<div class="block">Flushes all changes to objects in this context to the parent DataChannel, cascading
flush operation all the way through the stack, ultimately saving data in the
database.</div>
</li>
</ul>
<a name="commitChangesToParent()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>commitChangesToParent</h4>
<pre>void&nbsp;commitChangesToParent()</pre>
<div class="block">Flushes all changes to objects in this context to the parent DataChannel. Same as
<a href="../../../org/apache/cayenne/ObjectContext.html#commitChanges()"><code>commitChanges()</code></a>, but no cascading flush occurs.</div>
</li>
</ul>
<a name="rollbackChanges()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>rollbackChanges</h4>
<pre>void&nbsp;rollbackChanges()</pre>
<div class="block">Resets all uncommitted changes made to the objects in this ObjectContext, cascading
rollback operation all the way through the stack.</div>
</li>
</ul>
<a name="rollbackChangesLocally()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>rollbackChangesLocally</h4>
<pre>void&nbsp;rollbackChangesLocally()</pre>
<div class="block">Resets all uncommitted changes made to the objects in this ObjectContext. Same as
<a href="../../../org/apache/cayenne/ObjectContext.html#rollbackChanges()"><code>rollbackChanges()()</code></a>, but rollback is local to this context and no
cascading changes undoing occurs.</div>
</li>
</ul>
<a name="performQuery(org.apache.cayenne.query.Query)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>performQuery</h4>
<pre><a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&nbsp;performQuery(<a href="../../../org/apache/cayenne/query/Query.html" title="interface in org.apache.cayenne.query">Query</a>&nbsp;query)</pre>
<div class="block">Executes a selecting query, returning a list of persistent objects or data rows.</div>
</li>
</ul>
<a name="performGenericQuery(org.apache.cayenne.query.Query)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>performGenericQuery</h4>
<pre><a href="../../../org/apache/cayenne/QueryResponse.html" title="interface in org.apache.cayenne">QueryResponse</a>&nbsp;performGenericQuery(<a href="../../../org/apache/cayenne/query/Query.html" title="interface in org.apache.cayenne.query">Query</a>&nbsp;query)</pre>
<div class="block">Executes any kind of query providing the result in a form of QueryResponse.</div>
</li>
</ul>
<a name="getGraphManager()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getGraphManager</h4>
<pre><a href="../../../org/apache/cayenne/graph/GraphManager.html" title="interface in org.apache.cayenne.graph">GraphManager</a>&nbsp;getGraphManager()</pre>
<div class="block">Returns GraphManager that manages object graph associated with this context.</div>
</li>
</ul>
<a name="getChannel()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getChannel</h4>
<pre><a href="../../../org/apache/cayenne/DataChannel.html" title="interface in org.apache.cayenne">DataChannel</a>&nbsp;getChannel()</pre>
<div class="block">Returns an DataChannel used by this context.</div>
</li>
</ul>
<a name="createChildContext()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>createChildContext</h4>
<pre><a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang">@Deprecated</a>
<a href="../../../org/apache/cayenne/ObjectContext.html" title="interface in org.apache.cayenne">ObjectContext</a>&nbsp;createChildContext()</pre>
<div class="block"><span class="strong">Deprecated.</span>&nbsp;<i>Since 3.1 replaced by <a href="../../../org/apache/cayenne/configuration/CayenneRuntime.html#getContext(org.apache.cayenne.DataChannel)"><code>CayenneRuntime.getContext(DataChannel)</code></a></i></div>
<div class="block">Creates and returns a new child ObjectContext.</div>
<dl><dt><span class="strong">Since:</span></dt>
<dd>3.0</dd></dl>
</li>
</ul>
<a name="hasChanges()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>hasChanges</h4>
<pre>boolean&nbsp;hasChanges()</pre>
<div class="block">Returns <code>true</code> if there are any modified, deleted or new objects
registered with this ObjectContext, <code>false</code> otherwise.</div>
<dl><dt><span class="strong">Since:</span></dt>
<dd>3.0</dd></dl>
</li>
</ul>
<a name="invalidateObjects(java.util.Collection)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>invalidateObjects</h4>
<pre>void&nbsp;invalidateObjects(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;?&gt;&nbsp;objects)</pre>
<div class="block">Invalidates a Collection of persistent objects. This operation only applies to the
objects already committed to the database and does nothing to the NEW objects. It
would remove each object's snapshot from caches and change object's state to
HOLLOW. On the next access to this object, the object will be refetched.</div>
</li>
</ul>
<a name="invalidateObjects(java.lang.Object[])">
<!-- -->
</a><a name="invalidateObjects(T...)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>invalidateObjects</h4>
<pre>&lt;T&gt;&nbsp;void&nbsp;invalidateObjects(T...&nbsp;objects)</pre>
<div class="block">Invalidates one or more persistent objects. Same as
<a href="../../../org/apache/cayenne/ObjectContext.html#invalidateObjects(java.util.Collection)"><code>invalidateObjects(Collection)</code></a> only with a vararg argument list for easier
invalidation of individual objects. If no arguments are passed to this method, it
does nothing.</div>
<dl><dt><span class="strong">Since:</span></dt>
<dd>3.1</dd></dl>
</li>
</ul>
<a name="getUserProperty(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getUserProperty</h4>
<pre><a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;getUserProperty(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;key)</pre>
<div class="block">Returns a user-defined property previously set via 'setUserProperty'. Concurrent
access to properties does not require any special synchronization</div>
<dl><dt><span class="strong">Since:</span></dt>
<dd>3.0</dd></dl>
</li>
</ul>
<a name="setUserProperty(java.lang.String, java.lang.Object)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>setUserProperty</h4>
<pre>void&nbsp;setUserProperty(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;key,
<a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;value)</pre>
<div class="block">Sets a user-defined property. Concurrent access to properties does not require any
special synchronization</div>
<dl><dt><span class="strong">Since:</span></dt>
<dd>3.0</dd></dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><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="class-use/ObjectContext.html">Use</a></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>
<div class="subNav">
<ul class="navList">
<li><a href="../../../org/apache/cayenne/LifecycleListener.html" title="interface in org.apache.cayenne"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../org/apache/cayenne/ObjectId.html" title="class in org.apache.cayenne"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?org/apache/cayenne/ObjectContext.html" target="_top">Frames</a></li>
<li><a href="ObjectContext.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../allclasses-noframe.html">All 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>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&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; 2001&#x2013;2014 <a href="http://cayenne.apache.org/">Apache Cayenne</a>. All rights reserved.</small></p>
</body>
</html>