Subject | Re: [Firebird-Java] Re: Non-numeric primary key |
---|---|
Author | Roman Rokytskyy |
Post date | 2004-08-17T09:09:14Z |
> I understand that:This command will not work. You can try using the pk-sql command using the
> org.jboss.ejb.plugins.cmp.jdbc.keygen.JDBCMySQLCreateCommand
> is not supported by Jaybird as it is not JDBC 3 compliant (as per
> the posting date of the above post).
generator and define corresponding select command for each bean. This does
not fit nice into auto-deployment scheme. For each table you can define a
post-create SQL to create a generator, but you cannot define the post-delete
command to delete it when table is dropped. Next redeployment will fail.
Another drawback of this command is additional SELECT that must be done for
each INSERT. Therefore I use something like:
public Integer ejbCreate(....) throws CreateException {
setId(SequenceGeneratorUtil.getNextSequence("myBeanName");
....
return null;
}
Roman