You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@db.apache.org by an...@apache.org on 2013/02/23 15:12:19 UTC
svn commit: r851672 [8/12] - in /websites/production/db/content/jdo: ./
guides/ releases/
Modified: websites/production/db/content/jdo/newshistory.html
==============================================================================
--- websites/production/db/content/jdo/newshistory.html (original)
+++ websites/production/db/content/jdo/newshistory.html Sat Feb 23 14:12:18 2013
@@ -1,5 +1,5 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<!-- Generated by Apache Maven Doxia Site Renderer 1.3 at Jan 20, 2013 -->
+<!-- Generated by Apache Maven Doxia Site Renderer 1.3 at Feb 23, 2013 -->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
@@ -12,7 +12,7 @@
</style>
<link rel="stylesheet" href="./css/print.css" type="text/css" media="print" />
<meta name="author" content="JDO Documentation Team" />
- <meta name="Date-Revision-yyyymmdd" content="20130120" />
+ <meta name="Date-Revision-yyyymmdd" content="20130223" />
<meta http-equiv="Content-Language" content="en" />
</head>
@@ -210,41 +210,41 @@
</div>
<div id="bodyColumn">
<div id="contentBox">
- <!-- Licensed to the Apache Software Foundation (ASF) under one or more
-contributor license agreements. See the NOTICE file distributed with
-this work for additional information regarding copyright ownership.
-The ASF licenses this file to You under the Apache License, Version 2.0
-(the "License"); you may not use this file except in compliance with
-the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License. -->
-
-
-
-<div class="section"><h2>Older JDO News<a name="Older_JDO_News"></a></h2>
-
-<p>
-<b>JDO code donated to Apache by Sun Microsystems, Inc.</b>
-</p>
-<p>On 9-Mar-2005 Sun Microsystems, Inc. officially donated
-to Apache Software Foundation the
-intellectual property known as Java Data Objects, v. 1.0.2 and
-successors thereto to the extent provided by Sun.
-</p>
-<p>
-This was accomplished via Schedule B-2 to the Software Grant and
-Corporate Contributor License Agreement (CCLA) between
-The Apache Software Foundation and Sun Microsystems, Inc.
-</p>
- </div>
-
-
+ <!-- Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License. -->
+
+
+
+<div class="section"><h2>Older JDO News<a name="Older_JDO_News"></a></h2>
+
+<p>
+<b>JDO code donated to Apache by Sun Microsystems, Inc.</b>
+</p>
+<p>On 9-Mar-2005 Sun Microsystems, Inc. officially donated
+to Apache Software Foundation the
+intellectual property known as Java Data Objects, v. 1.0.2 and
+successors thereto to the extent provided by Sun.
+</p>
+<p>
+This was accomplished via Schedule B-2 to the Software Grant and
+Corporate Contributor License Agreement (CCLA) between
+The Apache Software Foundation and Sun Microsystems, Inc.
+</p>
+ </div>
+
+
</div>
</div>
Modified: websites/production/db/content/jdo/object_retrieval.html
==============================================================================
--- websites/production/db/content/jdo/object_retrieval.html (original)
+++ websites/production/db/content/jdo/object_retrieval.html Sat Feb 23 14:12:18 2013
@@ -1,5 +1,5 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<!-- Generated by Apache Maven Doxia Site Renderer 1.3 at Jan 20, 2013 -->
+<!-- Generated by Apache Maven Doxia Site Renderer 1.3 at Feb 23, 2013 -->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
@@ -11,7 +11,7 @@
@import url("./css/site.css");
</style>
<link rel="stylesheet" href="./css/print.css" type="text/css" media="print" />
- <meta name="Date-Revision-yyyymmdd" content="20130120" />
+ <meta name="Date-Revision-yyyymmdd" content="20130223" />
<meta http-equiv="Content-Language" content="en" />
</head>
@@ -209,82 +209,82 @@
</div>
<div id="bodyColumn">
<div id="contentBox">
-
-
- <div class="section"><h2>Object Retrieval<a name="Object_Retrieval"></a></h2>
- <p>
- JDO provides persistence of objects. The logical next step after persisting
- objects is to retrieve them for use in your application.
- There are several ways to do this
- </p>
-
- <div class="section"><h3>Retrieve an object from its identity<a name="Retrieve_an_object_from_its_identity"></a></h3>
- <p>
- The simplest form of object retrieval is where we have the identity.
- This is simply
- </p>
- <div class="source"><pre>
-Object obj = pm.getObjectById(identity);
- </pre></div>
- <p>
- If the object is in the JDO cache then it is retrieved from there,
- otherwise the JDO implementation goes to the datastore. When the object
- is retrieved its fields are populated according to its Fetch Group.
- </p>
- </div>
-
- <div class="section"><h3>Retrieve an object based on its Extent<a name="Retrieve_an_object_based_on_its_Extent"></a></h3>
- <p>
- A persistable class can be persisted with an <b>Extent</b> of all
- instances of that type.
- You can use this to retrieve objects of the required type, like this
- </p>
- <div class="source"><pre>
-Extent ex = pm.getExtent(MyClass.class, true);
-Iterator iter = ex.iterator();
-while (iter.hasNext())
-{
- MyClass obj = (MyClass)iter.next();
- ...
-}</pre></div>
- <p>
- The second argument in the <i>getExtent</i> call is whether to include
- instances of subclasses.
- </p>
- <br />
- </div>
-
- <div class="section"><h3>Retrieve an object based on a criteria<a name="Retrieve_an_object_based_on_a_criteria"></a></h3>
- <p>
- Where we want to retrieve all objects based on some criteria (e.g all
- objects of class A where field 'x' of A is a certain value) we need to
- use a query language. JDO2 provides 2 options here. JDOQL is object-based
- and allows you to express your query in terms of the classes and fields
- you are using. SQL is datastore-based and allows you to express your query
- in terms of the datastore tables and columns.
- </p>
- <p>
- To give an example of a JDOQL query
- </p>
- <div class="source"><pre>
-Query q = pm.newQuery(MyClass.class, "field1 < value");
-q.declareParameters("int value");
-List results = q.execute(205);
-Iterator iter = results.iterator();
-while (iter.hasNext())
-{
- MyClass obj = (MyClass)iter.next();
-}</pre></div>
- <p>
- If the objects found by the query are in the JDO cache then they are
- retrieved from there, otherwise the JDO implementation goes to the
- datastore. When the objects are retrieved their fields are populated
- according to the Fetch Group.
- </p>
- </div>
- </div>
-
-
+
+
+ <div class="section"><h2>Object Retrieval<a name="Object_Retrieval"></a></h2>
+ <p>
+ JDO provides persistence of objects. The logical next step after persisting
+ objects is to retrieve them for use in your application.
+ There are several ways to do this
+ </p>
+
+ <div class="section"><h3>Retrieve an object from its identity<a name="Retrieve_an_object_from_its_identity"></a></h3>
+ <p>
+ The simplest form of object retrieval is where we have the identity.
+ This is simply
+ </p>
+ <div class="source"><pre>
+Object obj = pm.getObjectById(identity);
+ </pre></div>
+ <p>
+ If the object is in the JDO cache then it is retrieved from there,
+ otherwise the JDO implementation goes to the datastore. When the object
+ is retrieved its fields are populated according to its Fetch Group.
+ </p>
+ </div>
+
+ <div class="section"><h3>Retrieve an object based on its Extent<a name="Retrieve_an_object_based_on_its_Extent"></a></h3>
+ <p>
+ A persistable class can be persisted with an <b>Extent</b> of all
+ instances of that type.
+ You can use this to retrieve objects of the required type, like this
+ </p>
+ <div class="source"><pre>
+Extent ex = pm.getExtent(MyClass.class, true);
+Iterator iter = ex.iterator();
+while (iter.hasNext())
+{
+ MyClass obj = (MyClass)iter.next();
+ ...
+}</pre></div>
+ <p>
+ The second argument in the <i>getExtent</i> call is whether to include
+ instances of subclasses.
+ </p>
+ <br />
+ </div>
+
+ <div class="section"><h3>Retrieve an object based on a criteria<a name="Retrieve_an_object_based_on_a_criteria"></a></h3>
+ <p>
+ Where we want to retrieve all objects based on some criteria (e.g all
+ objects of class A where field 'x' of A is a certain value) we need to
+ use a query language. JDO2 provides 2 options here. JDOQL is object-based
+ and allows you to express your query in terms of the classes and fields
+ you are using. SQL is datastore-based and allows you to express your query
+ in terms of the datastore tables and columns.
+ </p>
+ <p>
+ To give an example of a JDOQL query
+ </p>
+ <div class="source"><pre>
+Query q = pm.newQuery(MyClass.class, "field1 < value");
+q.declareParameters("int value");
+List results = q.execute(205);
+Iterator iter = results.iterator();
+while (iter.hasNext())
+{
+ MyClass obj = (MyClass)iter.next();
+}</pre></div>
+ <p>
+ If the objects found by the query are in the JDO cache then they are
+ retrieved from there, otherwise the JDO implementation goes to the
+ datastore. When the objects are retrieved their fields are populated
+ according to the Fetch Group.
+ </p>
+ </div>
+ </div>
+
+
</div>
</div>
Modified: websites/production/db/content/jdo/orm_dtd.html
==============================================================================
--- websites/production/db/content/jdo/orm_dtd.html (original)
+++ websites/production/db/content/jdo/orm_dtd.html Sat Feb 23 14:12:18 2013
@@ -1,5 +1,5 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<!-- Generated by Apache Maven Doxia Site Renderer 1.3 at Jan 20, 2013 -->
+<!-- Generated by Apache Maven Doxia Site Renderer 1.3 at Feb 23, 2013 -->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
@@ -11,7 +11,7 @@
@import url("./css/site.css");
</style>
<link rel="stylesheet" href="./css/print.css" type="text/css" media="print" />
- <meta name="Date-Revision-yyyymmdd" content="20130120" />
+ <meta name="Date-Revision-yyyymmdd" content="20130223" />
<meta http-equiv="Content-Language" content="en" />
</head>
@@ -223,45 +223,45 @@
</div>
<div id="bodyColumn">
<div id="contentBox">
-
-
- <div class="section"><h2>Meta-Data - ORM<a name="Meta-Data_-_ORM"></a></h2>
- <p>
- JDO defines XML MetaData in <b>jdo</b> files as well as <b>orm</b> files.
- As always with XML, the metadata must match the defined DTD/XSD for that file type.
- This section describes the content of the <b>orm</b> files.
- The content of <b>jdo</b> files can be found <a href="jdo_dtd.html">here</a>.
- All <b>orm</b> files must contain a valid DTD/DOCTYPE specification. You can use PUBLIC or SYSTEM versions of these.
- </p>
- <p>
- Here are a couple of examples valid for <b>orm</b> files with DTD specification
- </p>
- <div class="source"><pre>
-<!DOCTYPE orm PUBLIC
- "-//Sun Microsystems, Inc.//DTD Java Data Objects Mapping Metadata 3.0//EN"
- "http://java.sun.com/dtd/orm_3_0.dtd">
-
-
-<!DOCTYPE orm SYSTEM "file:/javax/jdo/orm.dtd"></pre></div>
- <br />
- <p>
- Here is an example valid for <b>orm</b> files with XSD specification
- </p>
- <div class="source"><pre>
-<?xml version="1.0" encoding="UTF-8" ?>
-<orm xmlns="http://java.sun.com/xml/ns/jdo/orm"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/jdo/orm
- http://java.sun.com/xml/ns/jdo/orm_3_0.xsd">
- ...
-</orm></pre></div>
- <p>
- Your MetaData should match either the <a class="externalLink" href="http://java.sun.com/dtd/orm_3_0.dtd" target="_blank">DTD</a>
- or the <a class="externalLink" href="http://java.sun.com/xml/ns/jdo/orm_3_0.xsd" target="_blank">XSD</a> specification.
- </p>
-
- </div>
-
+
+
+ <div class="section"><h2>Meta-Data - ORM<a name="Meta-Data_-_ORM"></a></h2>
+ <p>
+ JDO defines XML MetaData in <b>jdo</b> files as well as <b>orm</b> files.
+ As always with XML, the metadata must match the defined DTD/XSD for that file type.
+ This section describes the content of the <b>orm</b> files.
+ The content of <b>jdo</b> files can be found <a href="jdo_dtd.html">here</a>.
+ All <b>orm</b> files must contain a valid DTD/DOCTYPE specification. You can use PUBLIC or SYSTEM versions of these.
+ </p>
+ <p>
+ Here are a couple of examples valid for <b>orm</b> files with DTD specification
+ </p>
+ <div class="source"><pre>
+<!DOCTYPE orm PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Java Data Objects Mapping Metadata 3.0//EN"
+ "http://java.sun.com/dtd/orm_3_0.dtd">
+
+
+<!DOCTYPE orm SYSTEM "file:/javax/jdo/orm.dtd"></pre></div>
+ <br />
+ <p>
+ Here is an example valid for <b>orm</b> files with XSD specification
+ </p>
+ <div class="source"><pre>
+<?xml version="1.0" encoding="UTF-8" ?>
+<orm xmlns="http://java.sun.com/xml/ns/jdo/orm"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/jdo/orm
+ http://java.sun.com/xml/ns/jdo/orm_3_0.xsd">
+ ...
+</orm></pre></div>
+ <p>
+ Your MetaData should match either the <a class="externalLink" href="http://java.sun.com/dtd/orm_3_0.dtd" target="_blank">DTD</a>
+ or the <a class="externalLink" href="http://java.sun.com/xml/ns/jdo/orm_3_0.xsd" target="_blank">XSD</a> specification.
+ </p>
+
+ </div>
+
</div>
</div>
Modified: websites/production/db/content/jdo/pm.html
==============================================================================
--- websites/production/db/content/jdo/pm.html (original)
+++ websites/production/db/content/jdo/pm.html Sat Feb 23 14:12:18 2013
@@ -1,5 +1,5 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<!-- Generated by Apache Maven Doxia Site Renderer 1.3 at Jan 20, 2013 -->
+<!-- Generated by Apache Maven Doxia Site Renderer 1.3 at Feb 23, 2013 -->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
@@ -11,7 +11,7 @@
@import url("./css/site.css");
</style>
<link rel="stylesheet" href="./css/print.css" type="text/css" media="print" />
- <meta name="Date-Revision-yyyymmdd" content="20130120" />
+ <meta name="Date-Revision-yyyymmdd" content="20130223" />
<meta http-equiv="Content-Language" content="en" />
</head>
@@ -209,212 +209,212 @@
</div>
<div id="bodyColumn">
<div id="contentBox">
-
-
- <div class="section"><h2>Persistence Manager<a name="Persistence_Manager"></a></h2>
- <p>
- Any JDO-enabled application will require at least one <i>PersistenceManager</i> (PM).
- This is obtained from the <a href="pmf.html">PersistenceManagerFactory</a> for the datastore.
- </p>
- <p>
- The simplest way of creating a <i>PersistenceManager</i>
- <a href="api20/apidocs/javax/jdo/PersistenceManager.html" target="_blank"><img src="images/javadoc.gif" alt="" /></a>
- is as follows
- </p>
- <div class="source"><pre>
-PersistenceManagerFactory pmf = JDOHelper.getPersistenceManagerFactory(props);
-PersistenceManager pm = pmf.getPersistenceManager();</pre></div>
- <p>
- A <i>PersistenceManager</i> is the key to all persistence operations in JDO. With it you can
- persist, update, delete, and retrieve objects from the datastore. A <i>PersistenceManager</i>
- has a single transaction.
- </p>
- <br />
-
- <div class="section"><h3>Persist Objects<a name="Persist_Objects"></a></h3>
- <p>
- To persist an object, the object must first be marked as persistable using
- <a href="metadata.html">MetaData (XML/Annotations)</a>. Then you would start the
- PM transaction, and use <i>makePersistent</i> as follows
- </p>
- <div class="source"><pre>
-PersistenceManager pm = pmf.getPersistenceManager();
-Transaction tx = pm.currentTransaction();
-try
-{
- // Start the transaction
- tx.begin();
-
- // Create the object to persist
- MyClass obj = new MyClass();
-
- // Persist it to the datastore
- pm.makePersistent(obj);
-
- // Commit the transaction, flushing the object to the datastore
- tx.commit();
-}
-catch (Exception e)
-{
- ... handle exceptions
-}
-finally
-{
- if (tx.isActive())
- {
- // Error occurred so rollback the transaction
- tx.rollback();
- }
- pm.close();
-}</pre></div>
- <p>
- The <i>makePersistent</i> method of <b>PersistenceManager</b> makes the object persistent in
- the datastore, and updates the 'state' of the object from <i>Transient</i> (at the start)
- to <i>Hollow</i> (after commit() of the transaction).
- </p>
- <p>
- When an object is persisted, if it has any other objects referenced from that object they
- also will be made persistent. This is referred to as <b>persistence-by-reachability</b>.
- The main benefit of this is that if you have an object graph to persist, then you don't
- need to call <i>makePersistent()</i> on all objects, instead just using one that can be
- used to find all of the others. <b>persistence-by-reachability</b> is also run at the time of
- calling <i>commit()</i> on the transaction. This has the effect that if you had called
- <i>makePersistent()</i> on an object and that had persisted another object, and before
- commit you had removed the relation to this other object, then at <i>commit()</i> the
- reachability algorithm will find that this other object is no longer reachable and will
- remove it from persistence.
- </p>
- <br />
- </div>
-
- <div class="section"><h3>Retrieve Objects<a name="Retrieve_Objects"></a></h3>
- <p>
- So we've made some of our objects persistent, and now we want to retrieve them in
- our application. Here's one way of retrieving objects of a particular type.
- </p>
- <div class="source"><pre>
-tx = pm.currentTransaction();
-try
-{
- tx.begin();
-
- Extent e = pm.getExtent(mydomain.MyClass.class, true);
- Iterator iter=e.iterator();
- while (iter.hasNext())
- {
- MyClass my_obj=(MyClass)iter.next();
- ...
- }
-
- tx.commit();
-}
-catch (Exception e)
-{
- if (tx.isActive())
- {
- tx.rollback();
- }
-}</pre></div>
- <p>
- The <b>Extent</b> interface is one of the ways to retrieve your objects.
- The others use the <b>Query</b> interface, allowing more precise filtering over the
- objects returned.
- </p>
- <br />
- </div>
-
- <div class="section"><h3>Update Objects<a name="Update_Objects"></a></h3>
- <p>
- To update an object we firstly retrieve it, as above, and then we call any of its
- mutator methods. For example
- </p>
- <div class="source"><pre>
-tx = pm.currentTransaction();
-try
-{
- tx.begin();
-
- Extent e = pm.getExtent(mydomain.MyClass.class, true);
- Iterator iter=e.iterator();
- while (iter.hasNext())
- {
- MyClass my_obj=(MyClass)iter.next();
- my_obj.setValue(25.0); // Change the value
- ...
- }
-
- tx.commit();
-}
-catch (Exception e)
-{
- if (tx.isActive())
- {
- tx.rollback();
- }
-}</pre></div>
- <p>
- When <i>setValue()</i> is called on the persistent object this change is intercepted
- by JDO and the value change will be automatically sent to the datastore ... transparently!
- </p>
- <br />
- </div>
-
- <div class="section"><h3>Delete Objects<a name="Delete_Objects"></a></h3>
- <p>
- So we can persist objects, and retrieve them. Now we want to remove one from persistence.
- </p>
- <div class="source"><pre>try
-{
- tx = pm.currentTransaction();
- tx.begin();
-
- ... (code to retrieve object in question) ...
-
- pm.deletePersistent(my_obj);
-
- tx.commit();
-}
-catch (Exception e)
-{
- if (tx.isActive())
- {
- tx.rollback();
- }
-}</pre></div>
- <br />
- </div>
-
- <div class="section"><h3>Making an object transient<a name="Making_an_object_transient"></a></h3>
- <p>
- As we have seen in the <a href="state_transition.html">JDO States guide</a>, an object can
- have many possible states. When we want to take an object and work on it, but removing
- its identity we can make it <b>transient</b>. This means that it will retain the values
- of its fields, yet will no longer be associated with the object in the datastore.
- We do this as follows
- </p>
- <div class="source"><pre>try
-{
- tx = pm.currentTransaction();
- tx.begin();
-
- ... (code to retrieve object in question) ...
-
- pm.makeTransient(my_obj);
-
- tx.commit();
-}
-catch (Exception e)
-{
- if (tx.isActive())
- {
- tx.rollback();
- }
-}
-
-... (code to work on "my_obj")</pre></div>
- </div>
- </div>
-
+
+
+ <div class="section"><h2>Persistence Manager<a name="Persistence_Manager"></a></h2>
+ <p>
+ Any JDO-enabled application will require at least one <i>PersistenceManager</i> (PM).
+ This is obtained from the <a href="pmf.html">PersistenceManagerFactory</a> for the datastore.
+ </p>
+ <p>
+ The simplest way of creating a <i>PersistenceManager</i>
+ <a href="api20/apidocs/javax/jdo/PersistenceManager.html" target="_blank"><img src="images/javadoc.gif" alt="" /></a>
+ is as follows
+ </p>
+ <div class="source"><pre>
+PersistenceManagerFactory pmf = JDOHelper.getPersistenceManagerFactory(props);
+PersistenceManager pm = pmf.getPersistenceManager();</pre></div>
+ <p>
+ A <i>PersistenceManager</i> is the key to all persistence operations in JDO. With it you can
+ persist, update, delete, and retrieve objects from the datastore. A <i>PersistenceManager</i>
+ has a single transaction.
+ </p>
+ <br />
+
+ <div class="section"><h3>Persist Objects<a name="Persist_Objects"></a></h3>
+ <p>
+ To persist an object, the object must first be marked as persistable using
+ <a href="metadata.html">MetaData (XML/Annotations)</a>. Then you would start the
+ PM transaction, and use <i>makePersistent</i> as follows
+ </p>
+ <div class="source"><pre>
+PersistenceManager pm = pmf.getPersistenceManager();
+Transaction tx = pm.currentTransaction();
+try
+{
+ // Start the transaction
+ tx.begin();
+
+ // Create the object to persist
+ MyClass obj = new MyClass();
+
+ // Persist it to the datastore
+ pm.makePersistent(obj);
+
+ // Commit the transaction, flushing the object to the datastore
+ tx.commit();
+}
+catch (Exception e)
+{
+ ... handle exceptions
+}
+finally
+{
+ if (tx.isActive())
+ {
+ // Error occurred so rollback the transaction
+ tx.rollback();
+ }
+ pm.close();
+}</pre></div>
+ <p>
+ The <i>makePersistent</i> method of <b>PersistenceManager</b> makes the object persistent in
+ the datastore, and updates the 'state' of the object from <i>Transient</i> (at the start)
+ to <i>Hollow</i> (after commit() of the transaction).
+ </p>
+ <p>
+ When an object is persisted, if it has any other objects referenced from that object they
+ also will be made persistent. This is referred to as <b>persistence-by-reachability</b>.
+ The main benefit of this is that if you have an object graph to persist, then you don't
+ need to call <i>makePersistent()</i> on all objects, instead just using one that can be
+ used to find all of the others. <b>persistence-by-reachability</b> is also run at the time of
+ calling <i>commit()</i> on the transaction. This has the effect that if you had called
+ <i>makePersistent()</i> on an object and that had persisted another object, and before
+ commit you had removed the relation to this other object, then at <i>commit()</i> the
+ reachability algorithm will find that this other object is no longer reachable and will
+ remove it from persistence.
+ </p>
+ <br />
+ </div>
+
+ <div class="section"><h3>Retrieve Objects<a name="Retrieve_Objects"></a></h3>
+ <p>
+ So we've made some of our objects persistent, and now we want to retrieve them in
+ our application. Here's one way of retrieving objects of a particular type.
+ </p>
+ <div class="source"><pre>
+tx = pm.currentTransaction();
+try
+{
+ tx.begin();
+
+ Extent e = pm.getExtent(mydomain.MyClass.class, true);
+ Iterator iter=e.iterator();
+ while (iter.hasNext())
+ {
+ MyClass my_obj=(MyClass)iter.next();
+ ...
+ }
+
+ tx.commit();
+}
+catch (Exception e)
+{
+ if (tx.isActive())
+ {
+ tx.rollback();
+ }
+}</pre></div>
+ <p>
+ The <b>Extent</b> interface is one of the ways to retrieve your objects.
+ The others use the <b>Query</b> interface, allowing more precise filtering over the
+ objects returned.
+ </p>
+ <br />
+ </div>
+
+ <div class="section"><h3>Update Objects<a name="Update_Objects"></a></h3>
+ <p>
+ To update an object we firstly retrieve it, as above, and then we call any of its
+ mutator methods. For example
+ </p>
+ <div class="source"><pre>
+tx = pm.currentTransaction();
+try
+{
+ tx.begin();
+
+ Extent e = pm.getExtent(mydomain.MyClass.class, true);
+ Iterator iter=e.iterator();
+ while (iter.hasNext())
+ {
+ MyClass my_obj=(MyClass)iter.next();
+ my_obj.setValue(25.0); // Change the value
+ ...
+ }
+
+ tx.commit();
+}
+catch (Exception e)
+{
+ if (tx.isActive())
+ {
+ tx.rollback();
+ }
+}</pre></div>
+ <p>
+ When <i>setValue()</i> is called on the persistent object this change is intercepted
+ by JDO and the value change will be automatically sent to the datastore ... transparently!
+ </p>
+ <br />
+ </div>
+
+ <div class="section"><h3>Delete Objects<a name="Delete_Objects"></a></h3>
+ <p>
+ So we can persist objects, and retrieve them. Now we want to remove one from persistence.
+ </p>
+ <div class="source"><pre>try
+{
+ tx = pm.currentTransaction();
+ tx.begin();
+
+ ... (code to retrieve object in question) ...
+
+ pm.deletePersistent(my_obj);
+
+ tx.commit();
+}
+catch (Exception e)
+{
+ if (tx.isActive())
+ {
+ tx.rollback();
+ }
+}</pre></div>
+ <br />
+ </div>
+
+ <div class="section"><h3>Making an object transient<a name="Making_an_object_transient"></a></h3>
+ <p>
+ As we have seen in the <a href="state_transition.html">JDO States guide</a>, an object can
+ have many possible states. When we want to take an object and work on it, but removing
+ its identity we can make it <b>transient</b>. This means that it will retain the values
+ of its fields, yet will no longer be associated with the object in the datastore.
+ We do this as follows
+ </p>
+ <div class="source"><pre>try
+{
+ tx = pm.currentTransaction();
+ tx.begin();
+
+ ... (code to retrieve object in question) ...
+
+ pm.makeTransient(my_obj);
+
+ tx.commit();
+}
+catch (Exception e)
+{
+ if (tx.isActive())
+ {
+ tx.rollback();
+ }
+}
+
+... (code to work on "my_obj")</pre></div>
+ </div>
+ </div>
+
</div>
</div>
Modified: websites/production/db/content/jdo/pmf.html
==============================================================================
--- websites/production/db/content/jdo/pmf.html (original)
+++ websites/production/db/content/jdo/pmf.html Sat Feb 23 14:12:18 2013
@@ -1,5 +1,5 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<!-- Generated by Apache Maven Doxia Site Renderer 1.3 at Jan 20, 2013 -->
+<!-- Generated by Apache Maven Doxia Site Renderer 1.3 at Feb 23, 2013 -->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
@@ -11,7 +11,7 @@
@import url("./css/site.css");
</style>
<link rel="stylesheet" href="./css/print.css" type="text/css" media="print" />
- <meta name="Date-Revision-yyyymmdd" content="20130120" />
+ <meta name="Date-Revision-yyyymmdd" content="20130223" />
<meta http-equiv="Content-Language" content="en" />
</head>
@@ -209,445 +209,445 @@
</div>
<div id="bodyColumn">
<div id="contentBox">
-
-
- <div class="section"><h2>Persistence Manager Factory<a name="Persistence_Manager_Factory"></a></h2>
- <p>
- Any JDO-enabled application will require at least one <i>PersistenceManagerFactory</i>.
- Typically applications create one per datastore being utilised. A
- <i>PersistenceManagerFactory</i> provides access to <i>PersistenceManager</i>s which allow
- objects to be persisted, and retrieved. The <i>PersistenceManagerFactory</i> can be configured
- to provide particular behaviour.
- </p>
- <p>
- The simplest way of creating a <i>PersistenceManagerFactory</i>
- <a href="api20/apidocs/javax/jdo/PersistenceManagerFactory.html" target="_blank"><img src="images/javadoc.gif" alt="" /></a>
- is as follows
- </p>
- <div class="source"><pre>
-Properties properties = new Properties();
-properties.setProperty("javax.jdo.PersistenceManagerFactoryClass",
- "{my_implementation_pmf_class}");
-properties.setProperty("javax.jdo.option.ConnectionDriverName","com.mysql.jdbc.Driver");
-properties.setProperty("javax.jdo.option.ConnectionURL","jdbc:mysql://localhost/myDB");
-properties.setProperty("javax.jdo.option.ConnectionUserName","login");
-properties.setProperty("javax.jdo.option.ConnectionPassword","password");
-PersistenceManagerFactory pmf = JDOHelper.getPersistenceManagerFactory(properties);</pre></div>
- <p>
- A slight variation on this, is to use a file ("jdo.properties" for example) to specify these
- properties like this
- </p>
- <div class="source"><pre>
-javax.jdo.PersistenceManagerFactoryClass={my_implementation_pmf_class}
-javax.jdo.option.ConnectionDriverName=com.mysql.jdbc.Driver
-javax.jdo.option.ConnectionURL=jdbc:mysql://localhost/myDB
-javax.jdo.option.ConnectionUserName=login
-javax.jdo.option.ConnectionPassword=password</pre></div>
- <p>
- and then to create the <i>PersistenceManagerFactory</i> using this file
- </p>
- <div class="source"><pre>
-PersistenceManagerFactory pmf = JDOHelper.getPersistenceManagerFactory("jdo.properties");</pre></div>
- <p>
- A final alternative would be to call
- <i>JDOHelper.getPersistenceManagerFactory(jndiLocation, context);</i>, hence
- accessing the properties via JNDI.
- </p>
- <p>
- Whichever way we wish to obtain the <i>PersistenceManagerFactory</i> we have defined a
- series of properties to give the behaviour of the <i>PersistenceManagerFactory</i>.
- The first property specifies to use PMF of the implementation required to be used,
- and the following 4 properties define the datastore that it should connect to.
- </p>
- <br />
-
- <div class="section"><h3>Standard JDO Properties<a name="Standard_JDO_Properties"></a></h3>
- <table border="0" class="bodyTable">
- <tr class="a">
- <th colspan="2">
- <b>javax.jdo.PersistenceManagerFactoryClass</b>
- </th>
- </tr>
- <tr class="b">
- <td width="120">Description</td>
- <td>The name of the PersistenceManager implementation</td>
- </tr>
- </table>
- <br />
- <table border="0" class="bodyTable">
- <tr class="a">
- <th colspan="2">
- <b>javax.jdo.option.ConnectionFactory</b>
- </th>
- </tr>
- <tr class="b">
- <td width="120">Description</td>
- <td>Instance of a connection factory. For RBDMS, it must be an instance of
- javax.sql.DataSource. <b>This is for a transactional DataSource</b></td>
- </tr>
- </table>
- <br />
- <table border="0" class="bodyTable">
- <tr class="a">
- <th colspan="2">
- <b>javax.jdo.option.ConnectionFactory2</b>
- </th>
- </tr>
- <tr class="b">
- <td width="120">Description</td>
- <td>Instance of a connection factory. For RBDMS, it must be an instance of
- javax.sql.DataSource. <b>This is for a non-transactional DataSource</b></td>
- </tr>
- </table>
- <br />
- <table border="0" class="bodyTable">
- <tr class="a">
- <th colspan="2">
- <b>javax.jdo.option.ConnectionFactoryName</b>
- </th>
- </tr>
- <tr class="b">
- <td width="120">Description</td>
- <td>The JNDI name for a connection factory. For RBDMS, it must be a JNDI name
- that points to a javax.sql.DataSource object.
- <b>This is for a transactional DataSource</b></td>
- </tr>
- </table>
- <br />
- <table border="0" class="bodyTable">
- <tr class="a">
- <th colspan="2">
- <b>javax.jdo.option.ConnectionFactory2Name</b>
- </th>
- </tr>
- <tr class="b">
- <td width="120">Description</td>
- <td>The JNDI name for a connection factory. For RBDMS, it must be a JNDI name
- that points to a javax.sql.DataSource object.
- <b>This is for a non-transactional DataSource</b></td>
- </tr>
- </table>
- <br />
- <table border="0" class="bodyTable">
- <tr class="a">
- <th colspan="2">
- <b>javax.jdo.option.ConnectionDriverName</b>
- </th>
- </tr>
- <tr class="b">
- <td width="120">Description</td>
- <td>The name of the driver to use for the DB</td>
- </tr>
- </table>
- <br />
- <table border="0" class="bodyTable">
- <tr class="a">
- <th colspan="2">
- <b>javax.jdo.option.ConnectionDriverURL</b>
- </th>
- </tr>
- <tr class="b">
- <td width="120">Description</td>
- <td>URL specifying the datastore to use for persistence</td>
- </tr>
- </table>
- <br />
- <table border="0" class="bodyTable">
- <tr class="a">
- <th colspan="2">
- <b>javax.jdo.option.ConnectionUserName</b>
- </th>
- </tr>
- <tr class="b">
- <td width="120">Description</td>
- <td>Username to use for connecting to the DB</td>
- </tr>
- </table>
- <br />
- <table border="0" class="bodyTable">
- <tr class="a">
- <th colspan="2">
- <b>javax.jdo.option.ConnectionPassword</b>
- </th>
- </tr>
- <tr class="b">
- <td width="120">Description</td>
- <td>Password to use for connecting to the DB</td>
- </tr>
- </table>
- <br />
- <table border="0" class="bodyTable">
- <tr class="a">
- <th colspan="2">
- <b>javax.jdo.option.IgnoreCache</b>
- </th>
- </tr>
- <tr class="b">
- <td width="120">Description</td>
- <td>Whether to ignore the cache for queries</td>
- </tr>
- <tr class="a">
- <td>Range of Values</td>
- <td>true | false</td>
- </tr>
- </table>
- <br />
- <table border="0" class="bodyTable">
- <tr class="a">
- <th colspan="2">
- <b>javax.jdo.option.Multithreaded</b>
- </th>
- </tr>
- <tr class="b">
- <td width="120">Description</td>
- <td>Whether to run the PersistenceManager multithreaded</td>
- </tr>
- <tr class="a">
- <td>Range of Values</td>
- <td>true | false</td>
- </tr>
- </table>
- <br />
- <table border="0" class="bodyTable">
- <tr class="a">
- <th colspan="2">
- <b>javax.jdo.option.NontransactionalRead</b>
- </th>
- </tr>
- <tr class="b">
- <td width="120">Description</td>
- <td>Whether to allow nontransactional reads</td>
- </tr>
- <tr class="a">
- <td>Range of Values</td>
- <td>true | false</td>
- </tr>
- </table>
- <br />
- <table border="0" class="bodyTable">
- <tr class="a">
- <th colspan="2">
- <b>javax.jdo.option.NontransactionalWrite</b>
- </th>
- </tr>
- <tr class="b">
- <td width="120">Description</td>
- <td>Whether to allow nontransactional writes</td>
- </tr>
- <tr class="a">
- <td>Range of Values</td>
- <td>true | false</td>
- </tr>
- </table>
- <br />
- <table border="0" class="bodyTable">
- <tr class="a">
- <th colspan="2">
- <b>javax.jdo.option.Optimistic</b>
- </th>
- </tr>
- <tr class="b">
- <td width="120">Description</td>
- <td>Whether to use <a href="transactions.html">Optimistic transactions</a></td>
- </tr>
- <tr class="a">
- <td>Range of Values</td>
- <td>true | false</td>
- </tr>
- </table>
- <br />
- <table border="0" class="bodyTable">
- <tr class="a">
- <th colspan="2">
- <b>javax.jdo.option.RetainValues</b>
- </th>
- </tr>
- <tr class="b">
- <td width="120">Description</td>
- <td>Whether to suppress the clearing of values from persistent instances on transaction
- completion</td>
- </tr>
- <tr class="a">
- <td>Range of Values</td>
- <td>true | false</td>
- </tr>
- </table>
- <br />
- <table border="0" class="bodyTable">
- <tr class="a">
- <th colspan="2">
- <b>javax.jdo.option.RestoreValues</b>
- </th>
- </tr>
- <tr class="b">
- <td width="120">Description</td>
- <td>Whether persistent object have transactional field values restored when
- transaction rollback occurs.</td>
- </tr>
- <tr class="a">
- <td>Range of Values</td>
- <td>true | false</td>
- </tr>
- </table>
- <br />
- <table border="0" class="bodyTable">
- <tr class="a">
- <th colspan="2">
- <b>javax.jdo.option.Mapping</b>
- </th>
- </tr>
- <tr class="b">
- <td width="120">Description</td>
- <td>Name for the ORM MetaData mapping files to use with this PMF. For example if this is set to
- "mysql" then the implementation looks for MetaData mapping files called
- "{classname}-mysql.orm" or "package-mysql.orm". If this is not specified then the JDO
- implementation assumes that all is specified in the JDO MetaData file.
- <i>ORM datastores only</i></td>
- </tr>
- </table>
- <br />
- <table border="0" class="bodyTable">
- <tr class="a">
- <th colspan="2">
- <b>javax.jdo.mapping.Catalog</b>
- </th>
- </tr>
- <tr class="b">
- <td width="120">Description</td>
- <td>Name of the catalog to use by default for all classes persisted using this PMF.
- This can be overridden in the MetaData where required, and is optional.
- JPOX will prefix all table names with this catalog name if the RDBMS supports specification
- of catalog names in DDL.
- <i>ORM datastores only</i></td>
- </tr>
- </table>
- <br />
- <table border="0" class="bodyTable">
- <tr class="a">
- <th colspan="2">
- <b>javax.jdo.mapping.Schema</b>
- </th>
- </tr>
- <tr class="b">
- <td width="120">Description</td>
- <td>Name of the schema to use by default for all classes persisted using this PMF.
- This can be overridden in the MetaData where required, and is optional.
- JPOX will prefix all table names with this schema name if the RDBMS supports specification
- of schema names in DDL.
- <i>ORM datastores only</i></td>
- </tr>
- </table>
- <br />
- <table border="0" class="bodyTable">
- <tr class="a">
- <th colspan="2"><b>javax.jdo.option.DetachAllOnCommit</b></th>
- </tr>
- <tr class="b">
- <td width="120">Description</td>
- <td>Allows the user to select that when a transaction is committed all objects
- enlisted in that transaction will be automatically detached.</td>
- </tr>
- <tr class="a">
- <td>Range of Values</td>
- <td>true | <b>false</b></td>
- </tr>
- </table>
- <br />
- <table border="0" class="bodyTable">
- <tr class="a">
- <th colspan="2"><b>javax.jdo.option.CopyOnAttach</b></th>
- </tr>
- <tr class="b">
- <td width="120">Description</td>
- <td>Whether, when attaching a detached object, we create an attached copy or simply
- migrate the detached object to attached state. This is from JDO 2.1</td>
- </tr>
- <tr class="a">
- <td>Range of Values</td>
- <td><b>true</b> | false</td>
- </tr>
- </table>
- <br />
- <table border="0" class="bodyTable">
- <tr class="a">
- <th colspan="2"><b>javax.jdo.option.TransactionType</b></th>
- </tr>
- <tr class="b">
- <td width="120">Description</td>
- <td>Type of transaction to use. If running under J2SE the default is RESOURCE_LOCAL, and
- if running under J2EE the default is JTA.</td>
- </tr>
- <tr class="a">
- <td>Range of Values</td>
- <td>RESOURCE_LOCAL | JTA</td>
- </tr>
- </table>
- <br />
- <table border="0" class="bodyTable">
- <tr class="a">
- <th colspan="2"><b>javax.jdo.option.PersistenceUnitName</b></th>
- </tr>
- <tr class="b">
- <td width="120">Description</td>
- <td>Name of the "persistence-unit" to use with this PMF. This borrows the
- "persistence-unit" concept from JPA for use with JDO 2.1.</td>
- </tr>
- </table>
- <br />
- <table border="0" class="bodyTable">
- <tr class="a">
- <th colspan="2"><b>javax.jdo.option.ServerTimeZoneID</b></th>
- </tr>
- <tr class="b">
- <td width="120">Description</td>
- <td>Id of the TimeZone under which the datastore server is running.
- If this is not specified or is set to null it is assumed that the datastore server
- is running in the same timezone as the JVM under which the implementation is running.</td>
- </tr>
- </table>
- <br />
- <table border="0" class="bodyTable">
- <tr class="a">
- <th colspan="2"><b>javax.jdo.option.Name</b></th>
- </tr>
- <tr class="b">
- <td width="120">Description</td>
- <td>Name of the PMF. This is for use with "named PMF" functionality in JDO 2.1</td>
- </tr>
- </table>
- <br />
- <table border="0" class="bodyTable">
- <tr class="a">
- <th colspan="2"><b>javax.jdo.option.ReadOnly</b></th>
- </tr>
- <tr class="b">
- <td width="120">Description</td>
- <td>Whether this datastore should be treated as read only. Added in JDO 2.2</td>
- </tr>
- <tr class="a">
- <td>Range of Values</td>
- <td>true | <b>false</b></td>
- </tr>
- </table>
- <br />
- <table border="0" class="bodyTable">
- <tr class="a">
- <th colspan="2"><b>javax.jdo.option.TransactionIsolationLevel</b></th>
- </tr>
- <tr class="b">
- <td width="120">Description</td>
- <td>Isolation level to use for connections in the current transaction. Added in JDO 2.2</td>
- </tr>
- <tr class="a">
- <td>Range of Values</td>
- <td>none | read-committed | read-uncommitted | repeatable-read | snapshot | serializable</td>
- </tr>
- </table>
- <br />
- <br />
- </div>
- </div>
-
+
+
+ <div class="section"><h2>Persistence Manager Factory<a name="Persistence_Manager_Factory"></a></h2>
+ <p>
+ Any JDO-enabled application will require at least one <i>PersistenceManagerFactory</i>.
+ Typically applications create one per datastore being utilised. A
+ <i>PersistenceManagerFactory</i> provides access to <i>PersistenceManager</i>s which allow
+ objects to be persisted, and retrieved. The <i>PersistenceManagerFactory</i> can be configured
+ to provide particular behaviour.
+ </p>
+ <p>
+ The simplest way of creating a <i>PersistenceManagerFactory</i>
+ <a href="api20/apidocs/javax/jdo/PersistenceManagerFactory.html" target="_blank"><img src="images/javadoc.gif" alt="" /></a>
+ is as follows
+ </p>
+ <div class="source"><pre>
+Properties properties = new Properties();
+properties.setProperty("javax.jdo.PersistenceManagerFactoryClass",
+ "{my_implementation_pmf_class}");
+properties.setProperty("javax.jdo.option.ConnectionDriverName","com.mysql.jdbc.Driver");
+properties.setProperty("javax.jdo.option.ConnectionURL","jdbc:mysql://localhost/myDB");
+properties.setProperty("javax.jdo.option.ConnectionUserName","login");
+properties.setProperty("javax.jdo.option.ConnectionPassword","password");
+PersistenceManagerFactory pmf = JDOHelper.getPersistenceManagerFactory(properties);</pre></div>
+ <p>
+ A slight variation on this, is to use a file ("jdo.properties" for example) to specify these
+ properties like this
+ </p>
+ <div class="source"><pre>
+javax.jdo.PersistenceManagerFactoryClass={my_implementation_pmf_class}
+javax.jdo.option.ConnectionDriverName=com.mysql.jdbc.Driver
+javax.jdo.option.ConnectionURL=jdbc:mysql://localhost/myDB
+javax.jdo.option.ConnectionUserName=login
+javax.jdo.option.ConnectionPassword=password</pre></div>
+ <p>
+ and then to create the <i>PersistenceManagerFactory</i> using this file
+ </p>
+ <div class="source"><pre>
+PersistenceManagerFactory pmf = JDOHelper.getPersistenceManagerFactory("jdo.properties");</pre></div>
+ <p>
+ A final alternative would be to call
+ <i>JDOHelper.getPersistenceManagerFactory(jndiLocation, context);</i>, hence
+ accessing the properties via JNDI.
+ </p>
+ <p>
+ Whichever way we wish to obtain the <i>PersistenceManagerFactory</i> we have defined a
+ series of properties to give the behaviour of the <i>PersistenceManagerFactory</i>.
+ The first property specifies to use PMF of the implementation required to be used,
+ and the following 4 properties define the datastore that it should connect to.
+ </p>
+ <br />
+
+ <div class="section"><h3>Standard JDO Properties<a name="Standard_JDO_Properties"></a></h3>
+ <table border="0" class="bodyTable">
+ <tr class="a">
+ <th colspan="2">
+ <b>javax.jdo.PersistenceManagerFactoryClass</b>
+ </th>
+ </tr>
+ <tr class="b">
+ <td width="120">Description</td>
+ <td>The name of the PersistenceManager implementation</td>
+ </tr>
+ </table>
+ <br />
+ <table border="0" class="bodyTable">
+ <tr class="a">
+ <th colspan="2">
+ <b>javax.jdo.option.ConnectionFactory</b>
+ </th>
+ </tr>
+ <tr class="b">
+ <td width="120">Description</td>
+ <td>Instance of a connection factory. For RBDMS, it must be an instance of
+ javax.sql.DataSource. <b>This is for a transactional DataSource</b></td>
+ </tr>
+ </table>
+ <br />
+ <table border="0" class="bodyTable">
+ <tr class="a">
+ <th colspan="2">
+ <b>javax.jdo.option.ConnectionFactory2</b>
+ </th>
+ </tr>
+ <tr class="b">
+ <td width="120">Description</td>
+ <td>Instance of a connection factory. For RBDMS, it must be an instance of
+ javax.sql.DataSource. <b>This is for a non-transactional DataSource</b></td>
+ </tr>
+ </table>
+ <br />
+ <table border="0" class="bodyTable">
+ <tr class="a">
+ <th colspan="2">
+ <b>javax.jdo.option.ConnectionFactoryName</b>
+ </th>
+ </tr>
+ <tr class="b">
+ <td width="120">Description</td>
+ <td>The JNDI name for a connection factory. For RBDMS, it must be a JNDI name
+ that points to a javax.sql.DataSource object.
+ <b>This is for a transactional DataSource</b></td>
+ </tr>
+ </table>
+ <br />
+ <table border="0" class="bodyTable">
+ <tr class="a">
+ <th colspan="2">
+ <b>javax.jdo.option.ConnectionFactory2Name</b>
+ </th>
+ </tr>
+ <tr class="b">
+ <td width="120">Description</td>
+ <td>The JNDI name for a connection factory. For RBDMS, it must be a JNDI name
+ that points to a javax.sql.DataSource object.
+ <b>This is for a non-transactional DataSource</b></td>
+ </tr>
+ </table>
+ <br />
+ <table border="0" class="bodyTable">
+ <tr class="a">
+ <th colspan="2">
+ <b>javax.jdo.option.ConnectionDriverName</b>
+ </th>
+ </tr>
+ <tr class="b">
+ <td width="120">Description</td>
+ <td>The name of the driver to use for the DB</td>
+ </tr>
+ </table>
+ <br />
+ <table border="0" class="bodyTable">
+ <tr class="a">
+ <th colspan="2">
+ <b>javax.jdo.option.ConnectionDriverURL</b>
+ </th>
+ </tr>
+ <tr class="b">
+ <td width="120">Description</td>
+ <td>URL specifying the datastore to use for persistence</td>
+ </tr>
+ </table>
+ <br />
+ <table border="0" class="bodyTable">
+ <tr class="a">
+ <th colspan="2">
+ <b>javax.jdo.option.ConnectionUserName</b>
+ </th>
+ </tr>
+ <tr class="b">
+ <td width="120">Description</td>
+ <td>Username to use for connecting to the DB</td>
+ </tr>
+ </table>
+ <br />
+ <table border="0" class="bodyTable">
+ <tr class="a">
+ <th colspan="2">
+ <b>javax.jdo.option.ConnectionPassword</b>
+ </th>
+ </tr>
+ <tr class="b">
+ <td width="120">Description</td>
+ <td>Password to use for connecting to the DB</td>
+ </tr>
+ </table>
+ <br />
+ <table border="0" class="bodyTable">
+ <tr class="a">
+ <th colspan="2">
+ <b>javax.jdo.option.IgnoreCache</b>
+ </th>
+ </tr>
+ <tr class="b">
+ <td width="120">Description</td>
+ <td>Whether to ignore the cache for queries</td>
+ </tr>
+ <tr class="a">
+ <td>Range of Values</td>
+ <td>true | false</td>
+ </tr>
+ </table>
+ <br />
+ <table border="0" class="bodyTable">
+ <tr class="a">
+ <th colspan="2">
+ <b>javax.jdo.option.Multithreaded</b>
+ </th>
+ </tr>
+ <tr class="b">
+ <td width="120">Description</td>
+ <td>Whether to run the PersistenceManager multithreaded</td>
+ </tr>
+ <tr class="a">
+ <td>Range of Values</td>
+ <td>true | false</td>
+ </tr>
+ </table>
+ <br />
+ <table border="0" class="bodyTable">
+ <tr class="a">
+ <th colspan="2">
+ <b>javax.jdo.option.NontransactionalRead</b>
+ </th>
+ </tr>
+ <tr class="b">
+ <td width="120">Description</td>
+ <td>Whether to allow nontransactional reads</td>
+ </tr>
+ <tr class="a">
+ <td>Range of Values</td>
+ <td>true | false</td>
+ </tr>
+ </table>
+ <br />
+ <table border="0" class="bodyTable">
+ <tr class="a">
+ <th colspan="2">
+ <b>javax.jdo.option.NontransactionalWrite</b>
+ </th>
+ </tr>
+ <tr class="b">
+ <td width="120">Description</td>
+ <td>Whether to allow nontransactional writes</td>
+ </tr>
+ <tr class="a">
+ <td>Range of Values</td>
+ <td>true | false</td>
+ </tr>
+ </table>
+ <br />
+ <table border="0" class="bodyTable">
+ <tr class="a">
+ <th colspan="2">
+ <b>javax.jdo.option.Optimistic</b>
+ </th>
+ </tr>
+ <tr class="b">
+ <td width="120">Description</td>
+ <td>Whether to use <a href="transactions.html">Optimistic transactions</a></td>
+ </tr>
+ <tr class="a">
+ <td>Range of Values</td>
+ <td>true | false</td>
+ </tr>
+ </table>
+ <br />
+ <table border="0" class="bodyTable">
+ <tr class="a">
+ <th colspan="2">
+ <b>javax.jdo.option.RetainValues</b>
+ </th>
+ </tr>
+ <tr class="b">
+ <td width="120">Description</td>
+ <td>Whether to suppress the clearing of values from persistent instances on transaction
+ completion</td>
+ </tr>
+ <tr class="a">
+ <td>Range of Values</td>
+ <td>true | false</td>
+ </tr>
+ </table>
+ <br />
+ <table border="0" class="bodyTable">
+ <tr class="a">
+ <th colspan="2">
+ <b>javax.jdo.option.RestoreValues</b>
+ </th>
+ </tr>
+ <tr class="b">
+ <td width="120">Description</td>
+ <td>Whether persistent object have transactional field values restored when
+ transaction rollback occurs.</td>
+ </tr>
+ <tr class="a">
+ <td>Range of Values</td>
+ <td>true | false</td>
+ </tr>
+ </table>
+ <br />
+ <table border="0" class="bodyTable">
+ <tr class="a">
+ <th colspan="2">
+ <b>javax.jdo.option.Mapping</b>
+ </th>
+ </tr>
+ <tr class="b">
+ <td width="120">Description</td>
+ <td>Name for the ORM MetaData mapping files to use with this PMF. For example if this is set to
+ "mysql" then the implementation looks for MetaData mapping files called
+ "{classname}-mysql.orm" or "package-mysql.orm". If this is not specified then the JDO
+ implementation assumes that all is specified in the JDO MetaData file.
+ <i>ORM datastores only</i></td>
+ </tr>
+ </table>
+ <br />
+ <table border="0" class="bodyTable">
+ <tr class="a">
+ <th colspan="2">
+ <b>javax.jdo.mapping.Catalog</b>
+ </th>
+ </tr>
+ <tr class="b">
+ <td width="120">Description</td>
+ <td>Name of the catalog to use by default for all classes persisted using this PMF.
+ This can be overridden in the MetaData where required, and is optional.
+ JPOX will prefix all table names with this catalog name if the RDBMS supports specification
+ of catalog names in DDL.
+ <i>ORM datastores only</i></td>
+ </tr>
+ </table>
+ <br />
+ <table border="0" class="bodyTable">
+ <tr class="a">
+ <th colspan="2">
+ <b>javax.jdo.mapping.Schema</b>
+ </th>
+ </tr>
+ <tr class="b">
+ <td width="120">Description</td>
+ <td>Name of the schema to use by default for all classes persisted using this PMF.
+ This can be overridden in the MetaData where required, and is optional.
+ JPOX will prefix all table names with this schema name if the RDBMS supports specification
+ of schema names in DDL.
+ <i>ORM datastores only</i></td>
+ </tr>
+ </table>
+ <br />
+ <table border="0" class="bodyTable">
+ <tr class="a">
+ <th colspan="2"><b>javax.jdo.option.DetachAllOnCommit</b></th>
+ </tr>
+ <tr class="b">
+ <td width="120">Description</td>
+ <td>Allows the user to select that when a transaction is committed all objects
+ enlisted in that transaction will be automatically detached.</td>
+ </tr>
+ <tr class="a">
+ <td>Range of Values</td>
+ <td>true | <b>false</b></td>
+ </tr>
+ </table>
+ <br />
+ <table border="0" class="bodyTable">
+ <tr class="a">
+ <th colspan="2"><b>javax.jdo.option.CopyOnAttach</b></th>
+ </tr>
+ <tr class="b">
+ <td width="120">Description</td>
+ <td>Whether, when attaching a detached object, we create an attached copy or simply
+ migrate the detached object to attached state. This is from JDO 2.1</td>
+ </tr>
+ <tr class="a">
+ <td>Range of Values</td>
+ <td><b>true</b> | false</td>
+ </tr>
+ </table>
+ <br />
+ <table border="0" class="bodyTable">
+ <tr class="a">
+ <th colspan="2"><b>javax.jdo.option.TransactionType</b></th>
+ </tr>
+ <tr class="b">
+ <td width="120">Description</td>
+ <td>Type of transaction to use. If running under J2SE the default is RESOURCE_LOCAL, and
+ if running under J2EE the default is JTA.</td>
+ </tr>
+ <tr class="a">
+ <td>Range of Values</td>
+ <td>RESOURCE_LOCAL | JTA</td>
+ </tr>
+ </table>
+ <br />
+ <table border="0" class="bodyTable">
+ <tr class="a">
+ <th colspan="2"><b>javax.jdo.option.PersistenceUnitName</b></th>
+ </tr>
+ <tr class="b">
+ <td width="120">Description</td>
+ <td>Name of the "persistence-unit" to use with this PMF. This borrows the
+ "persistence-unit" concept from JPA for use with JDO 2.1.</td>
+ </tr>
+ </table>
+ <br />
+ <table border="0" class="bodyTable">
+ <tr class="a">
+ <th colspan="2"><b>javax.jdo.option.ServerTimeZoneID</b></th>
+ </tr>
+ <tr class="b">
+ <td width="120">Description</td>
+ <td>Id of the TimeZone under which the datastore server is running.
+ If this is not specified or is set to null it is assumed that the datastore server
+ is running in the same timezone as the JVM under which the implementation is running.</td>
+ </tr>
+ </table>
+ <br />
+ <table border="0" class="bodyTable">
+ <tr class="a">
+ <th colspan="2"><b>javax.jdo.option.Name</b></th>
+ </tr>
+ <tr class="b">
+ <td width="120">Description</td>
+ <td>Name of the PMF. This is for use with "named PMF" functionality in JDO 2.1</td>
+ </tr>
+ </table>
+ <br />
+ <table border="0" class="bodyTable">
+ <tr class="a">
+ <th colspan="2"><b>javax.jdo.option.ReadOnly</b></th>
+ </tr>
+ <tr class="b">
+ <td width="120">Description</td>
+ <td>Whether this datastore should be treated as read only. Added in JDO 2.2</td>
+ </tr>
+ <tr class="a">
+ <td>Range of Values</td>
+ <td>true | <b>false</b></td>
+ </tr>
+ </table>
+ <br />
+ <table border="0" class="bodyTable">
+ <tr class="a">
+ <th colspan="2"><b>javax.jdo.option.TransactionIsolationLevel</b></th>
+ </tr>
+ <tr class="b">
+ <td width="120">Description</td>
+ <td>Isolation level to use for connections in the current transaction. Added in JDO 2.2</td>
+ </tr>
+ <tr class="a">
+ <td>Range of Values</td>
+ <td>none | read-committed | read-uncommitted | repeatable-read | snapshot | serializable</td>
+ </tr>
+ </table>
+ <br />
+ <br />
+ </div>
+ </div>
+
</div>
</div>
Modified: websites/production/db/content/jdo/references.html
==============================================================================
--- websites/production/db/content/jdo/references.html (original)
+++ websites/production/db/content/jdo/references.html Sat Feb 23 14:12:18 2013
@@ -1,5 +1,5 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<!-- Generated by Apache Maven Doxia Site Renderer 1.3 at Jan 20, 2013 -->
+<!-- Generated by Apache Maven Doxia Site Renderer 1.3 at Feb 23, 2013 -->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
@@ -12,7 +12,7 @@
</style>
<link rel="stylesheet" href="./css/print.css" type="text/css" media="print" />
<meta name="author" content="JDO Documentation Team" />
- <meta name="Date-Revision-yyyymmdd" content="20130120" />
+ <meta name="Date-Revision-yyyymmdd" content="20130223" />
<meta http-equiv="Content-Language" content="en" />
</head>
@@ -210,57 +210,57 @@
</div>
<div id="bodyColumn">
<div id="contentBox">
- <!-- Licensed to the Apache Software Foundation (ASF) under one or more
-contributor license agreements. See the NOTICE file distributed with
-this work for additional information regarding copyright ownership.
-The ASF licenses this file to You under the Apache License, Version 2.0
-(the "License"); you may not use this file except in compliance with
-the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License. -->
-
- <div class="section"><h2>JDO References<a name="JDO_References"></a></h2>
- <div class="section"><h3>Articles<a name="Articles"></a></h3>
- <p>
- There have been several articles about JDO on various websites. Some are listed below
- </p>
- <ul>
- <li>SUN : <a class="externalLink" href="http://java.sun.com/products/jdo/" target="_blank">JDO Web Site</a></li>
- <li>SUN : <a class="externalLink" href="http://java.sun.com/developer/technicalArticles/J2SE/jdo/" target="_blank">Getting started with JDO</a></li>
- <li>TheServerSide.com : <a class="externalLink" href="http://www.theserverside.com/discussions/thread.tss?thread_id=771">discussion on JDO and Entity Beans</a></li>
- <li>TheServerSide.com : <a class="externalLink" href="http://www.theserverside.com/articles/article.tss?l=JDOQueryPart1" target="_blank">JDO 2 Queries - Methods, Paging, Unbound Variables</a></li>
- <li>TheServerSide.com : <a class="externalLink" href="http://www.theserverside.com/articles/article.tss?l=JDOQueryPart2" target="_blank">JDO 2 Queries - Projections, Aggregates</a></li>
- <li>DevX.com : <a class="externalLink" href="http://www.devx.com/java/article/16373/" target="_blank">JDO brings DB Programming into 21st Century Despite Controversy</a> by Dirk Bartels</li>
- <li><a class="externalLink" href="http://www.mainejug.org/jug/meetings/010829/index.htm" target="_blank">Java Data Objects</a> by David Ezzio</li>
- <li><a class="externalLink" href="http://www-128.ibm.com/developerworks/db2/library/techarticle/dm-0506bhogal/" target="_blank">Introduction to JDO2 using JPOX and DB2</a></li>
- <li><a class="externalLink" href="http://db.apache.org/derby/integrate/JPOX_Derby.html" target="_blank">Using JPOX with Apache Derby</a></li>
- </ul>
- <br />
- </div>
-
- <div class="section"><h3>Books<a name="Books"></a></h3>
- <p>
- A number of books covering JDO are available. Some are listed below
- </p>
- <ul>
- <li><a class="externalLink" href="http://www.oreilly.com/catalog/jvadtaobj/">
- <u>Java Data Objects</u></a> by Craig Russell and David Jordan. Publisher: O'Reilly
- </li>
- <li><a class="externalLink" href="http://www.phptr.com/bookstore/product.asp?isbn=0131407317&rl=1">
- <u>Core Java Data Objects</u></a> by Sameer Tyagi, Michael Vorburger, Keiron McCammon, Heiko Bobzin. Publisher: Prentice Hall
- </li>
- </ul>
- <br />
- </div>
-
-</div>
-
+ <!-- Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License. -->
+
+ <div class="section"><h2>JDO References<a name="JDO_References"></a></h2>
+ <div class="section"><h3>Articles<a name="Articles"></a></h3>
+ <p>
+ There have been several articles about JDO on various websites. Some are listed below
+ </p>
+ <ul>
+ <li>SUN : <a class="externalLink" href="http://java.sun.com/products/jdo/" target="_blank">JDO Web Site</a></li>
+ <li>SUN : <a class="externalLink" href="http://java.sun.com/developer/technicalArticles/J2SE/jdo/" target="_blank">Getting started with JDO</a></li>
+ <li>TheServerSide.com : <a class="externalLink" href="http://www.theserverside.com/discussions/thread.tss?thread_id=771">discussion on JDO and Entity Beans</a></li>
+ <li>TheServerSide.com : <a class="externalLink" href="http://www.theserverside.com/articles/article.tss?l=JDOQueryPart1" target="_blank">JDO 2 Queries - Methods, Paging, Unbound Variables</a></li>
+ <li>TheServerSide.com : <a class="externalLink" href="http://www.theserverside.com/articles/article.tss?l=JDOQueryPart2" target="_blank">JDO 2 Queries - Projections, Aggregates</a></li>
+ <li>DevX.com : <a class="externalLink" href="http://www.devx.com/java/article/16373/" target="_blank">JDO brings DB Programming into 21st Century Despite Controversy</a> by Dirk Bartels</li>
+ <li><a class="externalLink" href="http://www.mainejug.org/jug/meetings/010829/index.htm" target="_blank">Java Data Objects</a> by David Ezzio</li>
+ <li><a class="externalLink" href="http://www-128.ibm.com/developerworks/db2/library/techarticle/dm-0506bhogal/" target="_blank">Introduction to JDO2 using JPOX and DB2</a></li>
+ <li><a class="externalLink" href="http://db.apache.org/derby/integrate/JPOX_Derby.html" target="_blank">Using JPOX with Apache Derby</a></li>
+ </ul>
+ <br />
+ </div>
+
+ <div class="section"><h3>Books<a name="Books"></a></h3>
+ <p>
+ A number of books covering JDO are available. Some are listed below
+ </p>
+ <ul>
+ <li><a class="externalLink" href="http://www.oreilly.com/catalog/jvadtaobj/">
+ <u>Java Data Objects</u></a> by Craig Russell and David Jordan. Publisher: O'Reilly
+ </li>
+ <li><a class="externalLink" href="http://www.phptr.com/bookstore/product.asp?isbn=0131407317&rl=1">
+ <u>Core Java Data Objects</u></a> by Sameer Tyagi, Michael Vorburger, Keiron McCammon, Heiko Bobzin. Publisher: Prentice Hall
+ </li>
+ </ul>
+ <br />
+ </div>
+
+</div>
+
</div>
</div>