Return-Path: Delivered-To: apmail-db-ddlutils-dev-archive@www.apache.org Received: (qmail 96949 invoked from network); 5 Aug 2006 16:14:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 5 Aug 2006 16:14:38 -0000 Received: (qmail 89440 invoked by uid 500); 5 Aug 2006 16:14:38 -0000 Delivered-To: apmail-db-ddlutils-dev-archive@db.apache.org Received: (qmail 89416 invoked by uid 500); 5 Aug 2006 16:14:38 -0000 Mailing-List: contact ddlutils-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ddlutils-dev@db.apache.org Delivered-To: mailing list ddlutils-dev@db.apache.org Received: (qmail 89405 invoked by uid 99); 5 Aug 2006 16:14:38 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 05 Aug 2006 09:14:38 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Sat, 05 Aug 2006 09:14:37 -0700 Received: (qmail 96900 invoked by uid 1977); 5 Aug 2006 16:14:17 -0000 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 5 Aug 2006 16:14:17 -0000 Date: Sat, 5 Aug 2006 09:14:17 -0700 (PDT) From: Thomas Fischer To: ddlutils-dev@db.apache.org Subject: Customisation of jdbc->sql type mapping Message-ID: <20060805083452.H90790@minotaur.apache.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Spam-Rating: localhost 1.6.2 0/1000/N X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N 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