David Goodwin wrote:
> Dain Sundstrom wrote:
>
>> It looks like you are trying to use a not-null foreign key column,
>> which is not supported by the CMP 2.0 persistence engine.
>>
>> -dain
>>
>
> Hello (again)
>
> Is this a limitation of CMP2 or jboss ?
A little of both. CMP2 assumes that a single valued cmr field can be
null, so the not-null would be further restriction beyond CMP2. To make
matters worse, the spec says that you can't set the value of a
relationship until post create. In JBossCMP we insert the new row
between create and post create, so the initial value will be null. The
spec does allow an "optimized" engine to delay insertion, but this is
not implemented yet. This is a low priority as all databases support
not-null foreign keys.
> I have run into this problem again :-(.
>
> From what I can see I have to have "NOT NULL" for my foreign key
> columns (my postgres book is in uni so i can't check that, but postgres
> appears to put the NOT NULL bit in for me by default even if i remove it
> from the schema).
Postgres is the only database other then hypersonic that I test against
before committing changes, so I assure that it works out of the box.
Are you attempting to use a foreign key as a primary key? If you are it
will definitely not work as primary keys are automatically not null in
every database (except for the crapy mySQL engine).
-dain
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user