[ 
https://issues.apache.org/jira/browse/TORQUE-369?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Max Philipp Wriedt reopened TORQUE-369:
---------------------------------------

I thought about it a little longer, i completely ignored the "foreign key 
checks = 0" part.
So this is still the right place to discuss this, also for ExternalSchema

> LoadExternalSchemaTransformer recursively includes when cross-referencing
> -------------------------------------------------------------------------
>
>                 Key: TORQUE-369
>                 URL: https://issues.apache.org/jira/browse/TORQUE-369
>             Project: Torque
>          Issue Type: Bug
>          Components: Templates
>    Affects Versions: 5.1, 6.0
>            Reporter: Max Philipp Wriedt
>            Assignee: Max Philipp Wriedt
>            Priority: Major
>
> When referencing an external schema (to use foreign key references in another 
> schema definition) and back referencing to its origin, we get an infinite 
> recursion.
> Affects: 
> org.apache.torque.templates.transformer.LoadExternalSchemaTransformer.transform()
> Example:
> First Schema:
> {code:java}
> <?xml version="1.0" encoding="UTF-8" ?>
> <database>
>     <external-schema filename=secondary-schema.xml" />
>     <table name="test" javaName="Test">
>         <column name="Id" javaName="Id" required="true" type="INTEGER" 
> primaryKey="true"/>
>         <column name="Name" javaName="Name" required="true" type="VARCHAR" 
> size="5"/>
>         <column name="foreign-key" javaName="ForeignKey" required="true" 
> type="INTEGER" size="2"/>
>         <!-- define foreign key to secondary scheme!-->
>     </table>
> </database>{code}
> Second Schema: 
> {code:java}
> <?xml version="1.0" encoding="UTF-8" ?>
> <database
>     xmlns="http://db.apache.org/torque/5.0/templates/database";
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>     xsi:schemaLocation="http://db.apache.org/torque/5.0/templates/database
>     
> https://db.apache.org/torque/torque-5.0/documentation/orm-reference/database-5-0-strict.xsd";
>  name="test" defaultIdMethod="native" defaultJavaType="object">
>     <external-schema filename=first-schema.xml" />
>     <table name="foreign-key" javaName="Test">
>         <column name="Id" javaName="Id" required="true" type="INTEGER" 
> primaryKey="true"/>
>         <column name="Name" javaName="Name" required="true" type="VARCHAR" 
> size="5"/>
>     </table>
>     <table name="test2" javaName="Test2">
>         <column name="Id" javaName="Id" required="true" type="INTEGER" 
> primaryKey="true"/>
>         <column name="Name" javaName="Name" required="true" type="VARCHAR" 
> size="5"/>
>         <column name="foreign-key" javaName="ForeignKey" required="true" 
> type="INTEGER" size="2"/>
>         <!-- define foreign key to first scheme!-->
>     </table>
> </database>{code}
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to