0 Replies Latest reply on Jul 22, 2003 4:41 AM by null null

    auto-increment and Oracle

    null null Newbie

      I've written a few entity beans to use jboss, and it all deploys okay, and seems to run okay (except for rather painful performance when it first starts up!). This is on an Oracle database

      Anyway. This is a pre-existing database, for which I am writing beans that can handle it. When I add a new row I'm not sure how to specify the entity-create-command.

      I've tried the get-generated-keys but this throws a NotImplementedException. Also, the current design of the database means that the auto-increment is done using triggers, and that even if the value is set to non-null it will be assigned a new value from a sequence.

      Is there an EntityCommand that deals with this issue? I'm not quite sure otherwise how to go about it. In standard JDBC code we use RETURNING INTO Oracle extensions, but I can't see any code that does this as an entitycommand plugin, and also the AbstractVendorCreateEntityCommand expects to execute a second query, and I believe that this has to be done with the first query.

      Is there any easy solution to this that I have overlooked, or am I better off writing a special CreateEntityCommand based on JDBCCreateEntityCommand?