[
http://issues.apache.org/jira/browse/TORQUE-6?page=comments#action_12375626 ]
Joerg Friedrich commented on TORQUE-6:
--------------------------------------
In the past it looked like this:
ALTER TABLE TACL
ADD CONSTRAINT TACL_FK_1 FOREIGN KEY (PERSONKEY)
REFERENCES TPERSON (PKEY);
ALTER TABLE TACL
ADD CONSTRAINT TACL_FK_2 FOREIGN KEY (ROLEKEY)
REFERENCES TROLE (PKEY);
ALTER TABLE TACL
ADD CONSTRAINT TACL_FK_3 FOREIGN KEY (PROJKEY)
REFERENCES TPROJECT (PKEY);
ALTER TABLE TBASELINE
ADD CONSTRAINT TBASELINE_FK_1 FOREIGN KEY (WORKITEMKEY)
REFERENCES TWORKITEM (WORKITEMKEY);
I have not used the onUpdate and onDelete feature, since it does not work for
all database systems and thus we had to put this functionality into the
application logic.
The Firebird/Interbase manual states that it supports "ON DELETE CASCADE" and
"ON UPDATE CASCADE" (exactly like this) in constraints.
> 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:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]