blob: 3298600b622a16139504347a0309ef70617ea105 [file] [log] [blame]
Title: DataChannel
<P><TT>&quot;org.apache.cayenne.DataChannel&quot;</TT> is an abstraction of Cayenne persistence stack. It is very simple - it defines only 4 methods, two for actually performing persistent operations, one to access metadata, and one - to access EventManager:</P>
<DIV class="code panel" style="border-width: 1px;"><DIV class="codeHeader panelHeader" style="border-bottom-width: 1px;"><B>DataChannel.java</B></DIV><DIV class="codeContent panelContent">
<PRE class="code-java"><SPAN class="code-keyword">public</SPAN> <SPAN class="code-keyword">interface</SPAN> DataChannel {
QueryResponse onQuery(ObjectContext originatingContext, Query query);
GraphDiff onSync(ObjectContext originatingContext, GraphDiff changes, <SPAN class="code-object">int</SPAN> syncType);
EventManager getEventManager();
EntityResolver getEntityResolver();
}</PRE>
</DIV></DIV>
<P>DataChannel is rarely used by the application directly. Instead ObjectContexts use it internally as an abstract persistent store. There are few kinds of DataChannels in Cayenne:</P>
<UL>
<LI>DataDomain (the most commonly used DataChannel) connects to one or more databases via DataNodes.</LI>
<LI>DataContext can serve as a DataChannel for other DataContexts</LI>
<LI>ClientChannel is a DataChannel that connects to a remote Cayenne service.</LI>
</UL>