geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Geronimo Wiki] Update of "Working with Enterprise JavaBeans" by AaronMulder
Date Sat, 09 Jul 2005 14:12:59 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Geronimo Wiki" for change notification.

The following page has been changed by AaronMulder:
http://wiki.apache.org/geronimo/Working_with_Enterprise_JavaBeans

------------------------------------------------------------------------------
  Primary keys of entity beans can be auto-generated. This can save you the trouble of providing
primary keys for entities in the create() call.  This feature may also be used to deploy entity
beans without a natural primary key, ''i.e.'' having a primary key class set to ''java.lang.Object''.
 The configuration of auto-generated primary key entity beans requires the configuration of
a ''key-generator'' element for each affected EJB.
  
  The children of the key-generator element define the strategy to be used to auto-generate
primary key instances. The provided strategies are:
-   * ''auto-increment-table'': use table generated primary keys (auto-generated on a table
other than the entity table);
+   * ''auto-increment-table'': use table generated primary keys (such as from an AUTO_INCREMENT
column or trigger);
    * ''sequence-table'': use a sequence table; and
    * ''sql-generator'': use any SQL statements.
    * ''custom-generator'': provide your own GBean implementing org.tranql.pkgenerator.!PrimaryKeyGenerator
(elsewhere) and refer to it here
@@ -194, +194 @@

      ...
      <key-generator>
        <auto-increment-table>
-         <sql>INSERT INTO SOME_OTHER_TABLE VALUES ()</sql>
+         <sql>INSERT INTO ENTITY_TABLE (col2, col3) VALUES (null, null)</sql>
          <return-type>java.lang.Integer</return-type>
        </auto-increment-table>
      </key-generator>
@@ -213, +213 @@

        </custom-generator>
      </key-generator>
  }}}
- 
- Note that Geronimo does not yet handle the case where the entity table itself has a primary
key field that is automatically populated.
  
  === CMP with Unknown Primary Key ===
  

Mime
View raw message