| <!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: </li> |
| <li>Nested | </li> |
| <li>Field | </li> |
| <li>Constr | </li> |
| <li><a href="#method_summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li>Constr | </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"> </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> |
| <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><?></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> 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><?> objects)</code> |
| <div class="block">Schedules deletion of a collection of persistent objects.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code><T> void</code></td> |
| <td class="colLast"><code><strong><a href="../../../org/apache/cayenne/ObjectContext.html#deleteObjects(T...)">deleteObjects</a></strong>(T... 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> 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><?> objects)</code> |
| <div class="block">Invalidates a Collection of persistent objects.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colFirst"><code><T> void</code></td> |
| <td class="colLast"><code><strong><a href="../../../org/apache/cayenne/ObjectContext.html#invalidateObjects(T...)">invalidateObjects</a></strong>(T... 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> 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> prototype)</code> |
| <div class="block"><strong>Deprecated.</strong> |
| <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><T> T</code></td> |
| <td class="colLast"><code><strong><a href="../../../org/apache/cayenne/ObjectContext.html#localObject(T)">localObject</a></strong>(T 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><?></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><T> 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><T> 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><?></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> 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> 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> 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> property, |
| boolean 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> 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> 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> 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> 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> 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> 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> 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><?></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> 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><?> 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><?> 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><?> 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><?> 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> localObject(<a href="../../../org/apache/cayenne/ObjectId.html" title="class in org.apache.cayenne">ObjectId</a> 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> prototype)</pre> |
| <div class="block"><span class="strong">Deprecated.</span> <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><T> T localObject(T 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><T> T 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><T> 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 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> 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 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> 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 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><?> 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><T> void deleteObjects(T... 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 prepareForAccess(<a href="../../../org/apache/cayenne/Persistent.html" title="interface in org.apache.cayenne">Persistent</a> 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> property, |
| boolean 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 propertyChanged(<a href="../../../org/apache/cayenne/Persistent.html" title="interface in org.apache.cayenne">Persistent</a> 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> 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> 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> 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 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 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 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 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> performQuery(<a href="../../../org/apache/cayenne/query/Query.html" title="interface in org.apache.cayenne.query">Query</a> 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> performGenericQuery(<a href="../../../org/apache/cayenne/query/Query.html" title="interface in org.apache.cayenne.query">Query</a> 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> 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> 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> createChildContext()</pre> |
| <div class="block"><span class="strong">Deprecated.</span> <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 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 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><?> 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><T> void invalidateObjects(T... 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> 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> 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 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> 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> 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: </li> |
| <li>Nested | </li> |
| <li>Field | </li> |
| <li>Constr | </li> |
| <li><a href="#method_summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li>Constr | </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 © 2001–2014 <a href="http://cayenne.apache.org/">Apache Cayenne</a>. All rights reserved.</small></p> |
| </body> |
| </html> |