0 Replies Latest reply on May 17, 2005 5:34 PM by Satish Satish

    Auto Increment in MySQL throws EntityNotFoundException

    Satish Satish Newbie

      I am using XDoclet and MySQL 4.1.7.

      I was able to create a record for the related entity.
      However, when I try to invoke the primary key method on the local returned by the create method, I get an EntityNotFoundException.

      Here is the example:
      //Class level tag for the entity bean
      * @jboss.entity-command name="mysql-get-generated-keys"

      * This is the primary key for the entity
      * @ejb.interface-method
      * @ejb.persistence
      * column-name="id"
      public abstract java.lang.Integer getId();

      On the session bean I invoke

      EntityLocal local = MyEntityUtil.getLocalHome().create(...);

      // I get an error on the line below

      Can anyone tell me how I can get the generated promary key using auto-increment?