db-ddlutils-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Dudziak" <tom...@gmail.com>
Subject Re: Foreign Key problem
Date Wed, 07 Jun 2006 13:08:31 GMT
On 6/7/06, Terry Steichen <terry@net-frame.com> wrote:

> I forgot to mention that I had thought of that, and modified the name of
> the foreign key to a different name.  No change.
> Is it possible that the problem is that the target field for the foreign
> key (in the PERSPECTIVE table) is set for auto-increment?  (I've never
> been sure how this would/should work anyway, because you can't insert
> values into an auto-increment field.)

Well, that is not exactly true: you can insert into an auto-increment
field if the auto-increment is specified to allow this. For Derby,
this can be done via the "generate by default as identity" column
constraint (which is the one that DdlUtils uses). Though you'll likely
have problems later on because the identity value generator does not
pick up your inserted values, so it is likely that it spits out values
that you've inserted manually before.

> PS: when you say that the model worked fine for you, I presume you mean
> that you could create a structure using the schema I provided.  However,
> I think the problem (as you can see from the stacktrace) comes when you
> try to insert the data into that structure.

Yes, you're right, my mistake.
The stacktrace says that the key "15" is inserted twice, perhaps the
data that you insert is wrong ?


View raw message