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

Georg Kallidis updated TORQUE-358:
----------------------------------
    Description: 
Changing the example schema (src/test/schema.xml) adding a field e.g

 
{code:java}
<column
name="contactdata"
required="true"
type="VARCHAR"
size="500"
/>
{code}
in table "a" _after_ field "name" having a default value ("a_name") the HTML 
and XDOC outputs for field "contactdata" the default value from the preceding 
field. This happens only if it is a column with another column of the same type 
is set before. As a consequence the tests in JUNit - Test TestProcessing fail 
(test*docTemplate) - SQL and OM classes generation is not affected.

 

Another example of a schema.xml change. Result is that CURRENT_TIMESTAMP is in 
HTML/XDOC output for *both* fields (created_at, updated_at), while SQL and Java 
generation is done correctly.

 
{code:java}
<column
name="created_at"
required="true"
type="TIMESTAMP"
default="CURRENT_TIMESTAMP"
scale="6"
/>
<column
name="updated_at"
required="true"
type="TIMESTAMP"
scale="6"
/>
{code}
 

 

Fixing seems to me not easy as far as I can see - some complex velocity 
inheritance mechanism (velocity 1.7) is used, the fields seems to inherit from  
other fields in the same table.

Workaround may be done by overriding explicitely the attribute resetting it in 
schema.xml.

But I think this feature is neither at the core of Torque nor it is documented 
(I did not know about it before).

[https://db.apache.org/torque/torque-4.0/index.html] states quite lakonikely:

_torque-templatesThe Torque Templates contain the building blocks used by the 
generator to create the O/R classes, SQL scripts *and the like*. You can extend 
or change the templates if you want to customize the output of the generator, 
or even write templates of your own._

Generation of SQL and OM classes is not concerned (apparently uses different 
code). What about, just skipping this (almost unknown) feature (HTML and XDOC 
generation), until it is fixed/reimplemented in an upcoming release? 

  was:
Changing the example schema (src/test/schema.xml) adding a field e.g

 
{code:java}
<column
name="contactdata"
required="true"
type="VARCHAR"
size="500"
/>
{code}
in table "a" _after_ field "name" having a default value ("a_name") the HTML 
and XDOC  the default value from the preceding field is set for filed 
"contactdata". This happens only if it is a column with another column of the 
same type before. As a consequence the JUNit - Test TestProcessing fails 
(test*docTemplate) - SQL generation is not affected.

 

Another example of a schema.xml change. Result is that CURRENT_TIMESTAMP is in 
HTML/XDOC output for *both* fields (created_at, updated_at), while SQL and Java 
generation is done correctly.

 
{code:java}
<column
name="created_at"
required="true"
type="TIMESTAMP"
default="CURRENT_TIMESTAMP"
scale="6"
/>
<column
name="updated_at"
required="true"
type="TIMESTAMP"
scale="6"
/>
{code}
 

 

Fixing seems to me not easy as far as I can see - some complex velocity 
inheritance mechanism (velocity 1.7) is used, the fields seems to inherit from  
other fields in the same table.

Workaround may be done by overriding explicitely the attribute resetting it in 
schema.xml.

But I think this feature is neither at the core of Torque nor it is documented 
(I did not know about it before).

[https://db.apache.org/torque/torque-4.0/index.html] states quite lakonikely:

_torque-templatesThe Torque Templates contain the building blocks used by the 
generator to create the O/R classes, SQL scripts *and the like*. You can extend 
or change the templates if you want to customize the output of the generator, 
or even write templates of your own._

Generation of SQL and OM classes is not concerned (apparently uses different 
code). What about, just skipping this (almost unknown) feature (HTML and XDOC 
generation), until it is fixed/reimplemented in an upcoming release? 


> HTML and XDOC generation -schema tabl fields inherits attribute value if not 
> set
> --------------------------------------------------------------------------------
>
>                 Key: TORQUE-358
>                 URL: https://issues.apache.org/jira/browse/TORQUE-358
>             Project: Torque
>          Issue Type: Bug
>          Components: Templates
>    Affects Versions: 4.1
>            Reporter: Georg Kallidis
>            Priority: Major
>             Fix For: 4.1
>
>
> Changing the example schema (src/test/schema.xml) adding a field e.g
>  
> {code:java}
> <column
> name="contactdata"
> required="true"
> type="VARCHAR"
> size="500"
> />
> {code}
> in table "a" _after_ field "name" having a default value ("a_name") the HTML 
> and XDOC outputs for field "contactdata" the default value from the preceding 
> field. This happens only if it is a column with another column of the same 
> type is set before. As a consequence the tests in JUNit - Test TestProcessing 
> fail (test*docTemplate) - SQL and OM classes generation is not affected.
>  
> Another example of a schema.xml change. Result is that CURRENT_TIMESTAMP is 
> in HTML/XDOC output for *both* fields (created_at, updated_at), while SQL and 
> Java generation is done correctly.
>  
> {code:java}
> <column
> name="created_at"
> required="true"
> type="TIMESTAMP"
> default="CURRENT_TIMESTAMP"
> scale="6"
> />
> <column
> name="updated_at"
> required="true"
> type="TIMESTAMP"
> scale="6"
> />
> {code}
>  
>  
> Fixing seems to me not easy as far as I can see - some complex velocity 
> inheritance mechanism (velocity 1.7) is used, the fields seems to inherit 
> from  other fields in the same table.
> Workaround may be done by overriding explicitely the attribute resetting it 
> in schema.xml.
> But I think this feature is neither at the core of Torque nor it is 
> documented (I did not know about it before).
> [https://db.apache.org/torque/torque-4.0/index.html] states quite lakonikely:
> _torque-templatesThe Torque Templates contain the building blocks used by the 
> generator to create the O/R classes, SQL scripts *and the like*. You can 
> extend or change the templates if you want to customize the output of the 
> generator, or even write templates of your own._
> Generation of SQL and OM classes is not concerned (apparently uses different 
> code). What about, just skipping this (almost unknown) feature (HTML and XDOC 
> generation), until it is fixed/reimplemented in an upcoming release? 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to