I've tried working with the JDO-examples supplied with castor.
I'm particularly interested in using the key-generator facility. Since the examples does'nt supply a example, i tried changing using key-generator="MAX" on the mapping of ProductGroup.
When this is done, i try to run the class Test, to see the results.
This results in the following error:
[test] java.sql.SQLException: General error, message from server: "Column 'group_id' cannot be null"
[test] at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1651)
[test] at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:889)
[test] at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:956)
[test] at com.mysql.jdbc.Connection.execSQL(Connection.java:1874)
[test] at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1700)
[test] at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1569)
[test] at org.exolab.castor.jdo.engine.SQLEngine.create(SQLEngine.java:626)
[test] at org.exolab.castor.persist.ClassMolder.create(ClassMolder.java:914)
[test] at org.exolab.castor.persist.LockEngine.create(LockEngine.java:454)
[test] at org.exolab.castor.persist.TransactionContext.create(TransactionContext.java:883)
[test] at org.exolab.castor.jdo.engine.DatabaseImpl.create(DatabaseImpl.java:368)
[test] at jdo.Test.run(Test.java:297)
[test] at jdo.Test.main(Test.java:76)
Why is this error occurring ?
- Re: [castor-dev] Using Key-generator="MAX" Dan Kristensen
- Re: [castor-dev] Using Key-generator="MAX" Bruce Snyder
