You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@empire-db.apache.org by Francis De Brabandere <fr...@gmail.com> on 2010/05/06 12:10:08 UTC

Re: on delete/update cascade

https://issues.apache.org/jira/browse/EMPIREDB-79

On Thu, May 6, 2010 at 11:02 AM, Rainer Döbele <do...@esteam.de> wrote:
> Hi Joe,
>
> you are right, 'on delete cascade' or 'on update cascade' is currently not provided with the DDL generation of relations.
> DBTable.setDeleteCascade does an internal cascading and is not the same.
>
> For the moment I can only recommend to derive a class from the database driver class you are using and override the method "createRelation(DBRelation r, DBSQLScript script)". Copy the code from the base class and add the cascade statements you require.
>
> I will put this on our TODO list in order to provide a more convenient solution for all databases.
>
> Rainer
>
> Joe Thurbon wrote:
>> re: on delete/update cascade
>>
>> Is there some way to specify 'on delete cascade' or 'on update cascade'
>> on foreign key constraints within empire-db?
>>
>> I have found the method DBTable.setDeleteCascade(boolean), but that
>> seems to affect only the Java object, not actually modify the foreign
>> key constraint in the database. It also seems to affect all of the
>> foreign key constraints on the table, which is not what I want.
>>
>> It seems like the 'correct' place for it would be in the DBReference or
>> DBRelation class, but I had no joy looking there.
>>
>> Cheers,
>> Joe
>
>



-- 
http://www.somatik.be
Microsoft gives you windows, Linux gives you the whole house.