db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arm...@apache.org
Subject cvs commit: db-ojb/src/doc/forrest/src/documentation/content/xdocs/docu/guides sequencemanager.xml
Date Fri, 30 Jul 2004 16:02:08 GMT
arminw      2004/07/30 09:02:08

  Modified:    src/doc/forrest/src/documentation/content/xdocs/docu/guides
                        sequencemanager.xml
  Log:
  update 'Force computation of unique values' part and add warning about side-effects
  
  Revision  Changes    Path
  1.2       +29 -13    db-ojb/src/doc/forrest/src/documentation/content/xdocs/docu/guides/sequencemanager.xml
  
  Index: sequencemanager.xml
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/doc/forrest/src/documentation/content/xdocs/docu/guides/sequencemanager.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- sequencemanager.xml	20 Jun 2004 09:12:33 -0000	1.1
  +++ sequencemanager.xml	30 Jul 2004 16:02:08 -0000	1.2
  @@ -38,14 +38,14 @@
                   <code>SequenceManagerXXXImpl</code>.
               </p>
   
  +            <anchor id="autoincrement"/>
               <section>
                   <title>Automatical assignment of unique values</title>
                   <p>
                       As mentioned in
  -                    <link href="site:mapping-tutorial">mapping tutorial</link>
OJB provides a mechanism to assign
  -                    unique values for primary key attributes. You just have to enable the
  -                    <code>autoincrement</code>
  -                    attribute in the respective
  +                    <link href="site:mapping-tutorial">mapping tutorial</link>
OJB provides a mechanism to automatic
  +                    assign unique values for primary key attributes. You just have to enable
the
  +                    <code>autoincrement</code> attribute in the respective
                       <link href="site:repository/field-descriptor">
                           <em>FieldDescriptor</em>
                       </link>
  @@ -74,13 +74,13 @@
                       <code>ARTICLE_ID</code>. The JDBC Type of
                       this column is
                       <code>INTEGER</code>. This
  -                    is a primary key column. OJB shall automatically assign unique values
  +                    is a primary key column and OJB shall automatically assign unique values
                       to this attribute.
                   </p>
   
                   <p>
  -                    This mechanism works for columns of type INTEGER, CHAR and
  -                    VARCHAR. This mechanism helps you to keep your business logic free
  +                    This mechanism works for all whole-numbered column types like BIGINT,
INTEGER, SMALLINT,...
  +                    and for CHAR, VARCHAR coliumns. This mechanism helps you to keep your
business logic free
                       from code that computes unique Ids for primary key attributes.
                   </p>
               </section>
  @@ -91,15 +91,31 @@
                   <p>
                       By default OJB triggers the computation
                       of unique ids during calls to PersistenceBroker.store(...).
  -                    Sometimes it will be necessary to have the ids computed in advance.
  +                    Sometimes it will be necessary to have the ids computed in advance,
  +                    before a new persistent object was written to database.
                       This can be done by simply obtaining the Identity of the respective
object as
                       follows:
                   </p>
                   <source><![CDATA[
  -Identity oid = new Identity(object, targetBroker);                 ]]></source>
  -                <fixme author="arminw">
  -                    Fix when new Identity creation concept is implemented.
  -                </fixme>
  +Identity oid = broker.serviceIdentity().buildIdentity(Object newPersistentObject);]]></source>
  +                <p>
  +                    This creates an <link href="ext:api/identity">Identity</link>
object for the
  +                    new persistent object and set all primary key values of the new persistent
object
  +                    - But it only works if <link href="#autoincrement"><code>autoincrement</code></link>
  +                    is enabled for the primary key fields.
  +                </p>
  +                <warning>
  +                    Force computation of unique values is not allowed when using <em>database
based
  +                    Identity columns</em> for primary key generation (e.g via
  +                    <link href="#native">Identity column supporting sequence manager</link>),
because the
  +                    <em>real</em> PK value is at the earliest available after
database insert operation. If you
  +                    nevertheless force PK computing, OJB will use an temporary dummy PK
value in the
  +                    Identity object and this may lead to unexpeted behavior.
  +                </warning>
  +                <p>
  +                    Info about lookup persistent objects by primary key fields
  +                    <link href="site:pb-tutorial/find-by-pk">see here</link>.
  +                </p>
               </section>
   
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message