1 Reply Latest reply on Feb 26, 2004 6:31 PM by aloubyansky

    SapDB autoincrement PK

    dsturze

      How do I setup the SapDB for an autoincrement PK for my CMP/Entitybean?

      I have a:

      - JBoss 3.2.3
      - EntityBean with PK (java.lang.Long id)
      - SAPDB 7.4

      My setup creates the table, but without the needed sequence.
      jbosscmp-jdbc.xml is configured for autoincement and does not touch the field, thus my DB complains it is null.
      If I understand correctly I need to add to jbosscmp-jdbc.xml for that bean an entity-command (some post had this for a MySql). But how does it look like for a SAPDB?

        • 1. Re: SapDB autoincrement PK
          aloubyansky

          JBossCMP does not create sequences by default.
          You could use post-table-create element in defaults or per entity like:
          [post-table-create]
          [sql-statement]some ddl 1[/sql-statement]
          ...
          [sql-statement]some ddl N[/sql-statement]
          [/post-table-create]