db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Fischer (JIRA)" <j...@apache.org>
Subject [jira] Commented: (TORQUE-6) Generator does not generate foreign key constraints for Interbase/Firebird
Date Fri, 21 Apr 2006 16:48:06 GMT
    [ http://issues.apache.org/jira/browse/TORQUE-6?page=comments#action_12375599 ] 

Thomas Fischer commented on TORQUE-6:

Because of the problems with the table creation order, I'd rather use something like the following
(taken from oracle's foreignkey.vm):

#foreach ($fk in $table.ForeignKeys)
ALTER TABLE $table.Name
    ADD CONSTRAINT $fk.Name FOREIGN KEY ($fk.LocalColumnNames)
    REFERENCES $fk.ForeignTableName ($fk.ForeignColumnNames)
#if ($fk.hasOnUpdate() && !$fk.OnUpdate.equalsIgnoreCase("cascade"))
ON UPDATE $fk.OnUpdate
#if ($fk.hasOnDelete())
ON DELETE $fk.OnDelete

Will this work for firebird/interbase ? Especially, does the onUpdate and onDelete parts make

> Generator does not generate foreign key constraints for Interbase/Firebird
> --------------------------------------------------------------------------
>          Key: TORQUE-6
>          URL: http://issues.apache.org/jira/browse/TORQUE-6
>      Project: Torque
>         Type: Bug

>   Components: Generator
>     Versions: 3.2
>     Reporter: Joerg Friedrich

> The generator does not generate foreign key constraints for Interbase/Firebird. This
could probably be easily fixed by adding a file foreignkey.vm to the sql/base/interbase directory
in the templates jar (torque-gen-templates-3.2.jar) containing this:
> #foreach ($fk in $table.ForeignKeys)
>     FOREIGN KEY ($fk.LocalColumnNames) REFERENCES $fk.ForeignTableName ($fk.ForeignColumnNames),
> #end

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org

View raw message