Return-Path: Delivered-To: apmail-db-ojb-dev-archive@www.apache.org Received: (qmail 41640 invoked from network); 27 Jul 2004 00:29:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 27 Jul 2004 00:29:39 -0000 Received: (qmail 79428 invoked by uid 500); 27 Jul 2004 00:29:37 -0000 Delivered-To: apmail-db-ojb-dev-archive@db.apache.org Received: (qmail 79373 invoked by uid 500); 27 Jul 2004 00:29:37 -0000 Mailing-List: contact ojb-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "OJB Developers List" Reply-To: "OJB Developers List" Delivered-To: mailing list ojb-dev@db.apache.org Received: (qmail 79358 invoked by uid 500); 27 Jul 2004 00:29:37 -0000 Received: (qmail 79353 invoked by uid 99); 27 Jul 2004 00:29:37 -0000 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.27.1) with SMTP; Mon, 26 Jul 2004 17:29:32 -0700 Received: (qmail 41601 invoked by uid 1510); 27 Jul 2004 00:29:31 -0000 Date: 27 Jul 2004 00:29:31 -0000 Message-ID: <20040727002931.41600.qmail@minotaur.apache.org> From: arminw@apache.org To: db-ojb-cvs@apache.org Subject: cvs commit: db-ojb/src/doc/forrest/src/documentation/content/xdocs site.xml X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N arminw 2004/07/26 17:29:31 Modified: src/doc/forrest/src/documentation/content/xdocs/docu/guides Tag: OJB_1_0_RELEASE basic-technique.xml connection.xml deployment.xml platforms.xml src/doc/forrest/src/documentation/content/xdocs/docu/tutorials Tag: OJB_1_0_RELEASE pb-tutorial.xml src/doc/forrest/src/documentation/content/xdocs/docu Tag: OJB_1_0_RELEASE faq.xml getting-started.xml src/doc/forrest/src/documentation/content/xdocs Tag: OJB_1_0_RELEASE site.xml Log: merge changes made since 1.0 from trunk to OJB_1_0_RELEASE branch Revision Changes Path No revision No revision 1.1.2.1 +14 -3 db-ojb/src/doc/forrest/src/documentation/content/xdocs/docu/guides/basic-technique.xml Index: basic-technique.xml =================================================================== RCS file: /home/cvs/db-ojb/src/doc/forrest/src/documentation/content/xdocs/docu/guides/basic-technique.xml,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -u -r1.1 -r1.1.2.1 --- basic-technique.xml 20 Jun 2004 09:12:33 -0000 1.1 +++ basic-technique.xml 27 Jul 2004 00:29:31 -0000 1.1.2.1 @@ -205,7 +205,10 @@ > ]]> - + + When using primitive primary key fields, please pay attention on + how OJB manage null for primitive PK/FK +
1:1 auto-xxx setting @@ -439,7 +442,10 @@ the repository file. But in some cases the default behaviour of OJB is undesired. Please read here for more information.

- + + When using primitive primary key fields, please pay attention on + how OJB manage null for primitive PK/FK +
1:n auto-xxx setting @@ -856,7 +862,12 @@ Role.

+ + When using primitive primary key fields, please pay attention on + how OJB manage null for primitive PK/FK + +
m:n auto-xxx setting

1.1.2.1 +26 -18 db-ojb/src/doc/forrest/src/documentation/content/xdocs/docu/guides/connection.xml Index: connection.xml =================================================================== RCS file: /home/cvs/db-ojb/src/doc/forrest/src/documentation/content/xdocs/docu/guides/connection.xml,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -u -r1.1 -r1.1.2.1 --- connection.xml 20 Jun 2004 09:12:33 -0000 1.1 +++ connection.xml 27 Jul 2004 00:29:31 -0000 1.1.2.1 @@ -212,43 +212,51 @@ used PersistenceBroker instance:

- -PersistenceBroker broker = PersistenceBrokerFactory. -createPersistenceBroker(myKey); + +broker.close();]]> +

+ After obtain the connection with + broker.serviceConnectionManager().getConnection(), the connection can be used + in a 'normal' way. The user is responsible for cleanup of created statements and result + sets, so close statements and result sets after use. +

+

+ For read-only operations there is no need to start a PB-tx. +

Do not commit the connection instance, this will be done by OJB when PersistenceBroker commit-/abortTransaction was called. +
+ Never do a Connection.close() call on the obtained connection instance + by hand!! +
+ This will be handled by the + ConnectionFactory.

- If no transaction was running, it is possible to release connection after - use by hand: + If no transaction is running, it is possible to release a connection after + use by hand with call:

- -pBroker.serviceConnectionManager().releaseConnection(); - +

This call cleanup the used connection and pass the instance to release method of ConnectionFactory (this will e.g. return connection it to pool or close it). +

+

If you don't do any connection cleanup at the latest the connection will be released on PB.close() call.

- - Never do a Connection.close() call on the obtained connection instance - by hand!! -
- This will be handled by the - ConnectionFactory. -

Users who interested in this section also interested in 'Is it possible to perform my own sql-queries in OJB?'. 1.1.2.1 +75 -47 db-ojb/src/doc/forrest/src/documentation/content/xdocs/docu/guides/deployment.xml Index: deployment.xml =================================================================== RCS file: /home/cvs/db-ojb/src/doc/forrest/src/documentation/content/xdocs/docu/guides/deployment.xml,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -u -r1.1 -r1.1.2.1 --- deployment.xml 20 Jun 2004 09:12:33 -0000 1.1 +++ deployment.xml 27 Jul 2004 00:29:31 -0000 1.1.2.1 @@ -95,61 +95,89 @@

- 3. Additional jar archives + 3. External dependencies that do not come with OJB

- OJB depends on several other jar archives. These jar files are - shipped in the - db-ojb-<version>/lib directory. - These jar files are listed here. + Some components of OJB depend on external libraries and components that + cannot be shipped with OJB. You'll also need these if you want to compile + OJB from source. Here is a list of these dependencies:

+
+
j2ee.jar
+
+ This is the main archive of the J2EE SDK. + We recommend that you use the 1.3 version as the 1.4 is rather new and not + thoroughly tested yet with OJB. +
+
jdo.jar, jdori*.jar
+
+ The JDO Reference implementation is required + if you plan to use the JDO Api. +
+
+
+ + +
+ 4. Optional jar archives that come with OJB

- Some of these jar files are only used during build-time and need not to be - be deployed in runtime environments. + Some of jar files in the lib folder are only used during build-time + or are only required by certain components of OJB, and so they might need not to + be needed in runtime environments.
- Apart from wasting disk space they do no harm. If you don't care you just take all jars from - db-ojb-<version>/lib. + Apart from wasting disk space they do no harm. If you don't care about disk space + you just take all jars from the lib folder.
- If you do care, here is the list of jars you can omit during runtime: + If you do care, here is the list of jars you might omit during runtime:

-
    -
  • - ant.jar -
  • -
  • - antlr.debug.jar -
  • -
  • - antlr_compiletime.jar -
  • -
  • - junit.jar -
  • -
  • - optional.jar -
  • -
  • - xalan.jar -
  • -
  • - ejb.jar -
  • -
  • - servlet.jar -
  • -
  • - jakarta-regexp-xxx.jar -
  • -
  • - torque-xxx.jar -
  • -
  • - velocity-xxx.jar -
  • -
+
+
ant-*.jar
+
+ These are the Apache Ant 1.6 jars. +
+
antlr-[version].jar
+
+ ANTLR is a parser generator which is + used in the ODMG component of OJB. If you only use the PB Api, then you + don't need this. +
+
junit.jar
+
+ Junit for running the unit tests. You'll need + this only if you're also writing unit tests for you app. +
+
xerces.jar, xml-apis.jar
+
+ The Xerces XML parser. Since most newer + JDK's ship with an XML parser, it is likely that you do not need these files. +
+
xalan.jar
+
+ Xalan is used to generate the unit test report, + so you'll probably don't need this. +
+
jakarta-regexp-[version].jar
+
+ The Jakarta Regular Expression library is + only used when building OJB from source. +
+
torque-xxx.jar, velocity-xxx.jar
+
+ Torque is used to generate concrete databases + from database-independent schema files. OJB uses it internally to setup databases + for the unit tests. +
+
xdoclet-[version].jar, xjavadoc-[version].jar, xdoclet-ojb-module-[version].jar, commons-collections-[version].jar
+
+ The XDoclet OJB module can be used + to generate the repository metadata and Torque schema files from Javadoc comments + in the Java source files. It is however not required at runtime, so you can safely + ignore these files then. +
+
- 4. Don't forget the JDBC driver + 5. Don't forget the JDBC driver

The repository.xml defines JDBC Connections to your runtime databases. To use the declared JDBC drivers the 1.1.2.1 +11 -1 db-ojb/src/doc/forrest/src/documentation/content/xdocs/docu/guides/platforms.xml Index: platforms.xml =================================================================== RCS file: /home/cvs/db-ojb/src/doc/forrest/src/documentation/content/xdocs/docu/guides/platforms.xml,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -u -r1.1 -r1.1.2.1 --- platforms.xml 20 Jun 2004 09:12:33 -0000 1.1 +++ platforms.xml 27 Jul 2004 00:29:31 -0000 1.1.2.1 @@ -41,6 +41,11 @@ This document explains basic concepts and shows how OJB can be configured to run against a specific RDBMS.

+

+ If you not already have done so, then you also might want to have a + look at the Getting Started + section which presents a sample skeleton project. +

Basic Concepts @@ -183,6 +188,11 @@

The o/r mappings for these tables are contained in the file repository_internal.xml. +

+

+ If you want to have a look at how these files could be used, + have a look at the the ojb-blank + sample project which is already prepared to use these files.

No revision No revision 1.1.2.1 +28 -2 db-ojb/src/doc/forrest/src/documentation/content/xdocs/docu/tutorials/pb-tutorial.xml Index: pb-tutorial.xml =================================================================== RCS file: /home/cvs/db-ojb/src/doc/forrest/src/documentation/content/xdocs/docu/tutorials/pb-tutorial.xml,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -u -r1.1 -r1.1.2.1 --- pb-tutorial.xml 20 Jun 2004 09:12:33 -0000 1.1 +++ pb-tutorial.xml 27 Jul 2004 00:29:31 -0000 1.1.2.1 @@ -204,11 +204,13 @@
+
Querying Persistent Objects

Once objects have been stored to the database, it is important to be able to get them - back. The PersistenceBroker API provides two mechanisms for building queries, by + back. The PersistenceBroker API provides two mechanisms for + building queries, by using a template object, or by using specific criteria.

+ + +
+ Find object by primary key +

+ In some cases only the primary key values (single field or n-fields for composed primary + keys) of an object are known. In OJB you have several ways to request the whole object. + It is possible to build a query as + shown above, but the smarter + solution is to use PersistenceBroker#getObjectByIdentity(Identity oid). An + Identity object is a unique representation of a persistence + capable object based on the object primary key values and the top-level class (abstract class, + interface or the class itself, depending on the + extent metadata mapping). +

+

+ For example, to find an Product with an single primary key of '23' + do +

+ +
+
No revision No revision 1.1.2.1 +32 -1 db-ojb/src/doc/forrest/src/documentation/content/xdocs/docu/faq.xml Index: faq.xml =================================================================== RCS file: /home/cvs/db-ojb/src/doc/forrest/src/documentation/content/xdocs/docu/faq.xml,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -u -r1.1 -r1.1.2.1 --- faq.xml 20 Jun 2004 09:12:35 -0000 1.1 +++ faq.xml 27 Jul 2004 00:29:31 -0000 1.1.2.1 @@ -829,6 +829,37 @@ + + + + How does OJB manage 'null' for primitive primary key? + + +

+ Primitive values (int, long, ...) can't be null, so OJB interpret '0' as null + for primitive PK/FK fields in persistent objects. Thus primitive PK fields of persistent objects should + never be represented by a '0' value in DB and never used as a + sequence key value. +
+ This is only true for primitive PK/FK fields (e.g. Integer(0) is allowed). + All other fields have 'normal' behavior. +

+
+
+ + + + + How to lookup object by primary key? + + +

+ Please see PB tutorial section. +

+
+
+ + Difference between getIteratorByQuery() and getCollectionByQuery()? 1.6.2.1 +10 -9 db-ojb/src/doc/forrest/src/documentation/content/xdocs/docu/getting-started.xml Index: getting-started.xml =================================================================== RCS file: /home/cvs/db-ojb/src/doc/forrest/src/documentation/content/xdocs/docu/getting-started.xml,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -u -r1.6 -r1.6.2.1 --- getting-started.xml 26 Jun 2004 23:45:15 -0000 1.6 +++ getting-started.xml 27 Jul 2004 00:29:31 -0000 1.6.2.1 @@ -658,8 +658,8 @@ protocol="jdbc" subprotocol="mysql" dbalias="//localhost/productmanager" - username="root" - password="" + username="steve" + password="secret" eager-release="false" batch-mode="false" useAutoCommit="1" @@ -732,17 +732,18 @@ ]]>

Of course, you'll need to setup the CLASSPATH before running - your application. You'll should add all jars except the ones for Torque - (torque-[version].jar, velocity-[version].jar - and commons-collections-[version].jar) and for the XDoclet OJB - module (xdoclet-[version].jar, xjavadoc-[version].jar - and xdoclet-ojb-module-[version].jar). + your application. You'll should add all jars from the lib + folder except the ones for Torque (torque-[version].jar, + velocity-[version].jar and commons-collections-[version].jar) + and for the XDoclet OJB module (xdoclet-[version].jar, + xjavadoc-[version].jar and xdoclet-ojb-module-[version].jar).

It is important to note that OJB per default assumes the OJB.properties and OJB-logging.properties files in the directory where you're starting the application. Hence, we changed to the build/resources - directory. + directory before running the application. This of course requires the compiled + classes to be on the classpath, as well (directory build/classes).

Per default, the same applies to the other configuration files No revision No revision 1.3.2.1 +15 -3 db-ojb/src/doc/forrest/src/documentation/content/xdocs/site.xml Index: site.xml =================================================================== RCS file: /home/cvs/db-ojb/src/doc/forrest/src/documentation/content/xdocs/site.xml,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -u -r1.3 -r1.3.2.1 --- site.xml 20 Jun 2004 20:58:16 -0000 1.3 +++ site.xml 27 Jul 2004 00:29:31 -0000 1.3.2.1 @@ -72,6 +72,7 @@ + @@ -81,7 +82,9 @@ - + + + @@ -199,6 +202,8 @@ + + @@ -260,13 +265,15 @@ - + + + @@ -298,9 +305,14 @@ + + + + + --------------------------------------------------------------------- To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org For additional commands, e-mail: ojb-dev-help@db.apache.org