insert with generated identity for Derby
Ryan Boder <[email protected]> Sun, 27 Sep 2009 01:27:13 -0400
| Newsgroups | gmane.comp.java.orm.simpleorm |
|---|---|
| Message-ID | <[email protected]> |
Hi, I'm trying to get identity generation on insert working with Derby. I have the driver set up so it creates the table with GENERATED BY DEFAULT AS IDENTITY for my identity field and it works fine. The problem occurs when I call session.ses.createWithGeneratedKey and then try to commit the new record. SimpleORM tries to call insert passing null for the identity field. Derby accepts an insert statement that either 1) doesn't specify a value for the identity column or 2) passes the value "default" for the identity column. Derby throws an error when SimpleORM tries to pass null for the generated column. How should I handle this? If there's no way then I'll have to change SimpleORM code to pass "default" instead of "null" but I'd prefer not to do that. Thanks, -- Ryan Boder 1 614 598 6339