aspose file tools*
The moose likes Object Relational Mapping and the fly likes Check the id Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Check the id" Watch "Check the id" New topic
Author

Check the id

Karel Vervaeke
Greenhorn

Joined: Jul 20, 2004
Posts: 4
You're saying your id has unsaved-value=null,
you should make sure that the java-type of this id is nullable.
int id; // is not nullable.

You should either
1) specify an unsaved-value (e.g. -1) and make sure you set the id to -1 when constructing the persistent object.

/or/
2) use an Integer id; (default=null)

HTH
Karel Vervaeke
Greenhorn

Joined: Jul 20, 2004
Posts: 4
Oops, that was supposed to be a reply to
http://www.coderanch.com/t/214822/ORM/java/one-many-relation

I'm reposting it there right now, moderators, please delete this thread :/
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Check the id