6 Replies Latest reply on Feb 4, 2002 3:15 PM by mpetteys

    NOT NULL for primary key fields in mySQL

    mnewcomb

      In JAWS, support was added for a 'nullable' element that you set to false for the primary key field in the jaws.xml file. Support for this was in the org.jboss.ejb.plugins.jaws.metadata.CMPFieldMetaData class.

      Now that we are using the jdbc-generic persistence engine, I look in the org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCCMPFieldMetaData class for the same functionality, but it isn't there.

      The SQL generated is: "CREATE TABLE BSOEJB (id INTEGER, type INTEGER, x DOUBLE, y DOUBLE, CONSTRAINT pk_BSOEJB PRIMARY KEY (id))".

      It must be: "CREATE TABLE BSOEJB (id INTEGER NOT NULL, type INTEGER, x DOUBLE, y DOUBLE, CONSTRAINT pk_BSOEJB PRIMARY KEY (id))".

      How do I get mySQL to work without false in my jbosscmp-jdbc.xml file for my primary keys?

      Thanks,
      Michael