mirror of https://github.com/apache/openjpa.git
OPENJPA-317. Documentation changes.
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@586282 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
a20d36c121
commit
e08320284e
|
@ -639,11 +639,11 @@ import org.apache.openjpa.persistence.*;
|
|||
|
||||
// temporarily disable query caching for all queries created from em
|
||||
OpenJPAEntityManager oem = OpenJPAPersistence.cast(em);
|
||||
oem.getFetchPlan ().setQueryResultCache(false);
|
||||
oem.getFetchPlan ().setQueryResultCacheEnabled(false);
|
||||
|
||||
// re-enable caching for a particular query
|
||||
OpenJPAQuery oq = oem.createQuery(...);
|
||||
oq.getFetchPlan().setQueryResultCache(true);
|
||||
oq.getFetchPlan().setQueryResultCacheEnabled(true);
|
||||
</programlisting>
|
||||
</example>
|
||||
</section>
|
||||
|
|
|
@ -2773,7 +2773,7 @@ import org.apache.openjpa.persistence.jdbc.*;
|
|||
Query q = em.createQuery("select m from Magazine m where m.title = 'JDJ'");
|
||||
OpenJPAQuery kq = OpenJPAPersistence.cast(q);
|
||||
JDBCFetchPlan fetch = (JDBCFetchPlan) kq.getFetchPlan ();
|
||||
fetch.setJoinSyntax(JDBCFetchPlan.JOIN_SYNTAX_SQL92);
|
||||
fetch.setJoinSyntax(JoinSyntax.SQL92);
|
||||
List results = q.getResultList();
|
||||
</programlisting>
|
||||
</example>
|
||||
|
@ -3266,9 +3266,9 @@ Query q = em.createQuery("select m from Magazine m where m.title = 'JDJ'");
|
|||
OpenJPAQuery kq = OpenJPAPersistence.cast(q);
|
||||
JDBCFetchPlan fetch = (JDBCFetchPlan) kq.getFetchPlan();
|
||||
fetch.setFetchBatchSize(20);
|
||||
fetch.setResultSetType(ResultSet.TYPE_SCROLL_INSENSITIVE);
|
||||
fetch.setFetchDirection(ResultSet.FETCH_FORWARD);
|
||||
fetch.setLRSSize(JDBCFetchPlan.SIZE_LAST);
|
||||
fetch.setResultSetType(ResultSetType.SCROLL_INSENSITIVE);
|
||||
fetch.setFetchDirection(FetchDirection.FORWARD);
|
||||
fetch.setLRSSizeAlgorithm(LRSSizeAlgorithm.LAST);
|
||||
List results = q.getResultList();
|
||||
</programlisting>
|
||||
</example>
|
||||
|
|
|
@ -154,7 +154,7 @@ number of objects you can set <literal>LargeTransaction</literal> to true and
|
|||
perform periodic flushes during your transaction to reduce its memory
|
||||
requirements. See the Javadoc:
|
||||
<ulink url="../javadoc/org/apache/openjpa/persistence/OpenJPAEntityManager.html">
|
||||
OpenJPAEntityManager.setLargeTransaction</ulink>. Note that transactions in
|
||||
OpenJPAEntityManager.setTrackChangesByType</ulink>. Note that transactions in
|
||||
large mode have to more aggressively flush items from the data cache.
|
||||
<para>
|
||||
If your transaction will visit objects that you know are very unlikely to be
|
||||
|
|
|
@ -2405,8 +2405,8 @@ import org.apache.openjpa.persistence.jdbc.*;
|
|||
Query q = em.createQuery("select p from Person p where p.address.state = 'TX'");
|
||||
OpenJPAQuery kq = OpenJPAPersistence.cast(q);
|
||||
JDBCFetchPlan fetch = (JDBCFetchPlan) kq.getFetchPlan();
|
||||
fetch.setEagerFetchMode(JDBCFetchPlan.EAGER_PARALLEL);
|
||||
fetch.setSubclassFetchMode(JDBCFetchPlan.EAGER_JOIN);
|
||||
fetch.setEagerFetchMode(FetchMode.PARALLEL);
|
||||
fetch.setSubclassFetchMode(FetchMode.JOIN);
|
||||
List results = q.getResultList();
|
||||
</programlisting>
|
||||
</example>
|
||||
|
|
|
@ -125,7 +125,7 @@ concurrency exception.
|
|||
</para>
|
||||
<para>
|
||||
You can stop OpenJPA from assuming the transaction will commit by invoking
|
||||
<methodname>OpenJPAEntityManager.setRollbackOnly</methodname> prior to detaching
|
||||
<methodname>EntityTransaction.setRollbackOnly</methodname> prior to detaching
|
||||
your objects. Setting the <literal>RollbackOnly</literal> flag prevents OpenJPA
|
||||
from flushing when detaching dirty objects; instead OpenJPA just runs its
|
||||
pre-flush actions (see the <methodname>OpenJPAEntityManager.preFlush
|
||||
|
@ -344,12 +344,18 @@ at runtime.
|
|||
for controlling detached state:
|
||||
</para>
|
||||
<programlisting>
|
||||
public static final int DETACH_LOADED;
|
||||
public static final int DETACH_FETCH_GROUPS;
|
||||
public static final int DETACH_ALL;
|
||||
public int getDetachState();
|
||||
public void setDetachState(int mode);
|
||||
public DetachStateType getDetachState();
|
||||
public void setDetachState(DetachStateType type);
|
||||
</programlisting>
|
||||
<para>
|
||||
The <classname>DetachStateType</classname> enum contains the following values:
|
||||
</para>
|
||||
<programlisting>
|
||||
enum DetachStateType {
|
||||
FETCH_GROUPS,
|
||||
LOADED,
|
||||
ALL
|
||||
}
|
||||
<section id="ref_guide_detach_field">
|
||||
<title>
|
||||
Detached State Field
|
||||
|
|
|
@ -1755,8 +1755,8 @@ public void addTransactionListener(Object listener);
|
|||
public void removeTransactionListener(Object listener);
|
||||
</programlisting>
|
||||
<para>
|
||||
These <classname>OpenJPAEntityManager</classname> methods allow you to add and
|
||||
remove listeners.
|
||||
These <classname>OpenJPAEntityManagerSPI</classname> methods allow you to add
|
||||
and remove listeners. These methods are outside the bounds of the published OpenJPA APIs, and are subject to change in the future.
|
||||
</para>
|
||||
<para>
|
||||
For details on the transaction framework, see the <literal>
|
||||
|
|
Loading…
Reference in New Issue