You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-dev@db.apache.org by "Joerg Friedrich (JIRA)" <ji...@apache.org> on 2006/04/20 16:54:05 UTC

[jira] Erstellt: (TORQUE-6) Generator does not generate foreign key constraints for Interbase/Firebird

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: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


[jira] Kommentiert: (TORQUE-6) Generator does not generate foreign key constraints for Interbase/Firebird

Posted by "Joerg Friedrich (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/TORQUE-6?page=comments#action_12376498 ] 

Joerg Friedrich commented on TORQUE-6:
--------------------------------------

I have made the following changes and tested with Firebird 1.5 (directory ...\templates\src\templates\sql\base\interbase:

1. remove the only active line from drop.vm since it creates exceptions if the table does not exist
2. modified file tablefk.vm (took the one from Oracle)
3. modified file foreignkey.vm (took the one from Oracle as suggested above)

Then it looks okay in my tests.






> 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: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


[jira] Commented: (TORQUE-6) Generator does not generate foreign key constraints for Interbase/Firebird

Posted by "Thomas Fischer (JIRA)" <ji...@apache.org>.
    [ 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
#end
#if ($fk.hasOnDelete())
ON DELETE $fk.OnDelete
#end
;

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

> 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: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


[jira] Resolved: (TORQUE-6) Generator does not generate foreign key constraints for Interbase/Firebird

Posted by "Thomas Fischer (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/TORQUE-6?page=all ]
     
Thomas Fischer resolved TORQUE-6:
---------------------------------

    Fix Version: 3.2.1
     Resolution: Fixed
      Assign To: Thomas Fischer

Fixed in SVN.
I did not change the drop table statement. This behaviour is consistent thoughout Torque and should be solved by separating the drop table statements from the create table statements.

> 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
>     Assignee: Thomas Fischer
>      Fix For: 3.2.1

>
> 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: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


[jira] Closed: (TORQUE-6) Generator does not generate foreign key constraints for Interbase/Firebird

Posted by "Thomas Vandahl (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/TORQUE-6?page=all ]

Thomas Vandahl closed TORQUE-6.
-------------------------------


> Generator does not generate foreign key constraints for Interbase/Firebird
> --------------------------------------------------------------------------
>
>                 Key: TORQUE-6
>                 URL: http://issues.apache.org/jira/browse/TORQUE-6
>             Project: Torque
>          Issue Type: Bug
>          Components: Generator
>    Affects Versions: 3.2
>            Reporter: Joerg Friedrich
>         Assigned To: Thomas Fischer
>             Fix For: 3.3
>
>
> 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: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


[jira] Kommentiert: (TORQUE-6) Generator does not generate foreign key constraints for Interbase/Firebird

Posted by "Joerg Friedrich (JIRA)" <ji...@apache.org>.
    [ 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: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org