Is there any support planned for customisation the mapping from jdbc types to sql types ? For example, users might want to use nvarchar2 instead of varchar for some reason.

In torque, users could do this using the db.props file for the different databases up to Torque 3.1.1. In Torque 3.2, the db.props file is gone and it is quite difficult for users to define their own mappings. This needs to be changed in Torque. However, it would make sense to do this in a manner that ddlutils might support in the future.

My current plan for Torque is to use the "domain" attribute in the torque schema file. A domain (I'm not finding this name intuitive, maybe there's a better one) is a kind of "custom column type" the user can define. For example, the user can define a type "SHORTVARCHAR" which corresponds to a varchar column with size 20. The user then can use the type "shortvarchar" as column type in the schema, and does not need to specify the size of 20 everywhere.

The plan would be to give the domain an additional attribute "sqlType" where also the sql type can be changed. So to use NVARCHAR columns, the user would be creating a domain called NVARCHAR2, and set its type to VARCHAR (i.e. it behaves like a varchar column for the java part) and its sqlType to NVARCHAR2.

As far as I know, ddlutils does not support the domain stuff at the moment, but there is a request in jira (ddlutils-84) that it should do so. Do you plan to implement something of the sort, or would you think that another way of dealing with custom mappings is more appropriate ?

     Thomas

Reply via email to