1 Reply Latest reply on Jan 1, 2007 12:44 PM by Wessel de Roode

    auto-increment PK and Informix

    Hamdy Farid Newbie

      After couple of sleepless nights I manged to get my CMP bean to work with auto-increment

      I am using xdoclet tags so that's how I will descripe the solution

      On the entity level


      On your primary key field "get"


      Thats all you have to do, next time you do ejbCreate() you don't need to provide an Id, jboss and the informix engine will provide you with the key.

      Another issue you might run into, which using that auto-incrment key in relations
      For example in M:M between two entities which have an auto-increment key. If you don't spcify the "jdbc-type, sql-type" in the jboss.relation, jboss will try to create a table with two serial fields which would fail. So make sure that you specify these two tags when using your auto-increment CMP fileds in a CMR