0 Replies Latest reply on Apr 17, 2003 11:25 AM by innovatis

    Problem with Entity ejbCreate() and "not null" fields in db'

    innovatis

      Hi all !

      I have a question related to the ejbCreate() method of an entity bean in JBoss.

      Is it possible (without adding additional code to the Entity Bean source) to define ex. in a deployment descriptor that the insert statement generated by JBoss when ejbCreate() is called considers some (not PK) fields that have been defined as "Not null" values in DB? For the time beeing a get the following obvious error message:

      16:04:09,130 ERROR [AcrTimeSheetEJB] Could not create entity
      java.sql.SQLException: General error, message from server: "Column 'idTask' cannot be null"
      at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1626)
      at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:886)
      at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:945)
      at com.mysql.jdbc.Connection.execSQL(Connection.java:1844)