db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Fox <Thomas....@seitenbau.net>
Subject Re: custom sql types in Torque 4
Date Tue, 08 May 2012 08:51:46 GMT


Thomas Vandahl wrote:
> > Am 07.05.2012 10:41, schrieb Thomas Fox:
> > The question is what to do if our correct mapping is not the mapping
the
> > user wants....
> Well, then, we could be in trouble when trying to get the data from
> JDBC. The one thing I always liked about Torque is that it makes it
> difficult to shoot yourself in the foot. This proposed method is IMO a
> way to make that shooting easier.
>
> Would it be a solution to simply use a one-to-one mapping everywhere?
> So that TIMESTAMP creates TIMESTAMP and not DATETIME?

I am afraid not. There is only one java.sql.Types.TIMESTAMP constant
(no DATETIME) and both DATETIME and TIMESTAMP data types in Mysql are
"compliant" with the JDBC Type java.sql.Types.TIMESTAMP only.
You will not get access to both MySQL types by a simple mapping
from java.sql.Types.
I reckon that MySQL was not designed with JDBC compatibility as a top
priority...

I am afraid there is no simple solution to the Schema types -> Database
types mapping problem. As written earlier, I do not have any heartblood
in this issue, I just thought it would make things easier and it is
analogous
to the javaType attribute where one can override the default java type.

    Thomas


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


Mime
View raw message