> > What do you mean by implicit use of sequences?
> Is it possible to have an incremental primary key without the 
> usage of sequences?

      <!-- uses key generator to fetch the next key value -->
      <entity-command name="key-generator"
 
class="org.jboss.ejb.plugins.cmp.jdbc.keygen.JDBCKeyGeneratorCreateComma
nd">
         <attribute
name="key-generator-factory">UUIDKeyGeneratorFactory</attribute>
      </entity-command>

key-generator-factory is the JNDI name under which an impl of
org.jboss.ejb.plugins.keygenerator.KeyGeneratorFactory is bound. UUID is
the only one that is available for now. You can write your own. For an
example look at org.jboss.ejb.plugins.keygenerator.uuid in the server
module.

> Which is the better way to have a incremental primary key?

I don't know. They all are so cute!

> > > Is there any way to automatically create the sequences if 
> they don't 
> > > still exist (something like: @jboss:create-table create="true")?
> >
> > At the moment, JBoss does not create sequences even if it 
> is setup to 
> > create tables. As a workaround, I think, you could use 
> something like 
> > @jboss.persistence post-table-create="CREATE SEQUENCE %%t_seq START 
> > WITH
> > 1 INCREMENT BY 1"
> Unfortunately the jboss.persistence tag doesn't seems to be 
> working....

I guess, the resulting jbosscmp-jdbc.xml should contain

<entity>
...
   <post-table-create>
      <sql-statement>any sql statement 1</sql-statement>
      <sql-statement>any sql statement 2</sql-statement>
      <sql-statement>any sql statement etc</sql-statement>
   </post-table-create>

   <table-name>MyTable</table-name>
   <cmp-field>
...



-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to