Return-Path:
null
for primitive PK/FK
+
null
for primitive PK/FK
+ Role
.
null
for primitive PK/FK
+
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:
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.
+ 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 +
+
+ 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.
+
+ Please see PB tutorial section. +
+
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 @@