You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-dev@db.apache.org by Tobias Hilka <th...@vps.de> on 2006/07/13 09:58:55 UTC

Datatype mapping in Torque 3.2

Hello everyone,

I just changed my torque version from 3.1.1 to 3.2. 

I made some changes to the standard mapping (VARCHAR = NVARCHAR2 ...) in
Torque 3.1.1 using the db.props file. But now this mapping moved to the
Platform classes. Is there any way to change the mapping in an easy way,
without changing the classes and recompiling the templates jar?

Best Regards,

Tobias

Re: Datatype mapping in Torque 3.2

Posted by Thomas Fischer <tf...@apache.org>.

On Sun, 16 Jul 2006, Thomas Vandahl wrote:

> Thomas Fischer wrote:
>> - extend the platform class you want to change, and end the classname with 
>> Impl. Put the resulting class in the same 
>> (org.apache.torque.engine.platform.Platform) package.
>> 
>> - set the torque.database property in the project.properties (NOT in the 
>> Torque.properties in the runtime, this should stay as it is) to the 
>> Classname without the "Impl" in the end (you may start lowercase)
>
> One comment about this. As you know, I try to collect the database specific 
> features in the database adapters. The platform implementation, however, is 
> part of the generator and contains database specific stuff, too. Does that 
> make sense? Wouldn't it be better to combine them both in one database 
> specific class?

Not so sure about this.
- The information about the database needed in the generator and in the 
runtime are different, so the only benefit would be to have one class 
instead of two
- the build process would be complicated, as the class would have to be 
delievered in the runtime and the generator

    Thomas

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


Re: Datatype mapping in Torque 3.2

Posted by Thomas Vandahl <tv...@apache.org>.
Thomas Fischer wrote:
> - extend the platform class you want to change, and end the classname 
> with Impl. Put the resulting class in the same 
> (org.apache.torque.engine.platform.Platform) package.
> 
> - set the torque.database property in the project.properties (NOT in the 
> Torque.properties in the runtime, this should stay as it is) to the 
> Classname without the "Impl" in the end (you may start lowercase)

One comment about this. As you know, I try to collect the database 
specific features in the database adapters. The platform implementation, 
however, is part of the generator and contains database specific stuff, 
too. Does that make sense? Wouldn't it be better to combine them both in 
one database specific class?

Bye, Thomas.

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


Re: Datatype mapping in Torque 3.2

Posted by Thomas Fischer <tf...@apache.org>.
Hi,

this should be a way that works

- extend the platform class you want to change, and end the classname with 
Impl. Put the resulting class in the same 
(org.apache.torque.engine.platform.Platform) package.

- set the torque.database property in the project.properties (NOT in the 
Torque.properties in the runtime, this should stay as it is) to the 
Classname without the "Impl" in the end (you may start lowercase)

For example: classname is 
org.apache.torque.engine.platform.Platform.MyOracleImpl
torque.database = myOracle

Please tell us whether that works.

     Thomas

for reference: Code of the PlatformFactory class:

     private static String getClassnameFor(String platform)
     {
         String pf = "Default";
         if (platform != null)
         {
             pf = platform;
         }
         return "org.apache.torque.engine.platform.Platform" + 
pf.substring(0, 1).toUpperCase() + pf.substring(1) + "Impl";
     }



On Thu, 13 Jul 2006, Tobias Hilka wrote:

> Hello everyone,
>
> I just changed my torque version from 3.1.1 to 3.2.
>
> I made some changes to the standard mapping (VARCHAR = NVARCHAR2 ...) in
> Torque 3.1.1 using the db.props file. But now this mapping moved to the
> Platform classes. Is there any way to change the mapping in an easy way,
> without changing the classes and recompiling the templates jar?
>
> Best Regards,
>
> Tobias
>

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