1 Reply Latest reply on Jun 24, 2002 3:56 PM by dsundstrom

    Compound PK constraint generation problem

    ldragone

      JBoss 3.0.0 seems unable to generate the correct SQL constraint for a compound primary key EJB, because it leaves the key field list empty. The server.log reports that it attempts to execute the following SQL statement:

      CREATE TABLE <table_name> (<field_definitions>, CONSTRAINT PK_<table_name> PRIMARY KEY ())

      and it obviously fails by a syntax error near "())".
      The statement templates in standardjbosscmp-jdbc.xml are like the following:

      <pk-constraint-template>CONSTRAINT ?1 PRIMARY KEY (?2)</pk-constraint-template>

      and they seem substantially correct. I have reported this behavior with both embedded Hypersonic SQL and MySQL 3.23.
      To overcome this problem I have temporarily disabled the pk constraint generation for compound key tables, but it is not a suitable solution.

      Any help will be appreciated.

      Luigi Dragone