users@glassfish.java.net

Re: One to one integrity is not maintained

From: <glassfish_at_javadesktop.org>
Date: Wed, 02 May 2007 21:02:16 PDT

Ketan,

The provider usually relies on the database to enforce the constraints - it'll take too long if the provider starts searching the database for each specific constraint. Are you mapping your entities to an existing database, or are you letting the provider to create the tables for you? In case of the former, is there a unique constraint on the FK? In case of the latter, are you sure that the provider adds such constraint (automatic schema generation is not required to be supported by the spec, so there is no guarantee that the provider follows up on your settings exactly)?

On a separate not, can it be the problem that you didn't specify the GenerationType which defaults the value to AUTO? In this case the provider might not be realizing that you want to use a sequence generator.

thanks,
-marina
[Message sent by forum member 'mvatkina' (mvatkina)]

http://forums.java.net/jive/thread.jspa?messageID=215266