This one time, at band camp, Dan Kristensen said:
DK>I've tried working with the JDO-examples supplied with castor.
DK>
DK>I'm particularly interested in using the key-generator facility. Since the
DK>examples does'nt supply a example, i tried changing using
DK>key-generator="MAX" on the mapping of ProductGroup.
DK>
DK>When this is done, i try to run the class Test, to see the results.
DK>
DK>This results in the following error:
DK>[test] java.sql.SQLException: General error, message from server: "Column
DK>'group_id' cannot be null"
DK>[test] at
DK>com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1651)
DK>[test] at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:889)
DK>[test] at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:956)
DK>[test] at com.mysql.jdbc.Connection.execSQL(Connection.java:1874)
DK>[test] at
DK>com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1700)
DK>
DK>[test] at
DK>com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1569)
DK>
DK>[test] at
DK>org.exolab.castor.jdo.engine.SQLEngine.create(SQLEngine.java:626)
DK>[test] at
DK>org.exolab.castor.persist.ClassMolder.create(ClassMolder.java:914)
DK>[test] at
DK>org.exolab.castor.persist.LockEngine.create(LockEngine.java:454)
DK>[test] at
DK>org.exolab.castor.persist.TransactionContext.create(TransactionContext.java:883)
DK>
DK>[test] at
DK>org.exolab.castor.jdo.engine.DatabaseImpl.create(DatabaseImpl.java:368)
DK>[test] at jdo.Test.run(Test.java:297)
DK>[test] at jdo.Test.main(Test.java:76)
DK>
DK>Why is this error occurring ?
Dan,
I'm not sure at the moment why this is not working with the
JDO examples. I suggest that you take a look at the tests in
src/tests/jdo. The tests are available in one of the source downloads or
from CVS. There are at least a few examples of using the MAX key generator
in there. I suggest taking a look at src/tests/jdo/KeyGenGeneric.java
as it tests the MAX key generator specifically.
Bruce
--
perl -e 'print unpack("u30","<0G)[EMAIL PROTECTED]&5R\"F9E<G)E=\$\!F<FEI+F-O;0\`\`");'
The Castor Project
http://www.castor.org/
Apache Geronimo
http://incubator.apache.org/projects/geronimo.html
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev