db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Georg Kallidis (Jira)" <j...@apache.org>
Subject [jira] [Resolved] (TORQUE-358) HTML and XDOC generation -schema table fields inherits attribute value if not set
Date Wed, 18 Dec 2019 09:54:00 GMT

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

Georg Kallidis resolved TORQUE-358.
      Assignee: Georg Kallidis
    Resolution: Fixed

- with fixing velocity templates, generation of xdoc and html is now as expected again, Revision:

> HTML and XDOC generation -schema table 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
>            Assignee: 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"
> 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

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

View raw message