db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Fischer <fisc...@seitenbau.net>
Subject RE: Mapping column types
Date Tue, 27 Dec 2005 09:23:38 GMT




Hi,

The property files were converted into java classes. They are located in
the subpackage "platform" of the generator.

>From your mail, it seems that the behaviour of the mysql driver changed
from mysql4 to mysql5.If I remember correctly, the bit type worked
correctly for mysql4 (I used the test project to check this, there is a
test case for bit in there).  I'll try to check the bit type against mysql5
in the next days.

As a workaraound, you can use the booleanint or booleanchar types.

    Thomas

"Thoralf Rickert" <thoralf.rickert@cadooz.de> schrieb am 23.12.2005
15:33:23:

> Hi!
>
> I'm switching currently from Torque 3.1 to 3.2 and have a problem with
> the column type boolean. I'm using MySQL 5.0.16 and the mysql connector
> 3.1.12. The table type is InnoDB.
>
> I've a table which contains a boolean, like this:
>
> <database name="test" defaultIdMethod="native" defaultJavaType="object">
>  <table name="test">
>    <column name="id" required="true" type="BIGINT" primaryKey="true"
> autoIncrement="true"/>
>    <column name="myBool" required="true" type="BIT" default="0"/>
>  </table>
> </database>
>
> The generated SQL syntax for the insert-sql task contains this:
>
> CREATE TABLE test
> (
>     id BIGINT NOT NULL AUTO_INCREMENT,
>     myBool BIT default 0 NOT NULL,
>     PRIMARY KEY(id)
> ) Type=InnoDB ;
>
> The database accepts this syntax, but when I create a Test object and
> save it to the database the boolean flag is always false.
>
>   test = new Test();
>   test.setMybool(new Boolean(false));
>   test.save();
>
> I'm not sure, if this is a Torque problem, because the BIT feature is
> new to MySQL and there was at least one bug about it, that I've
> reported. But my workaround in Torque 3.1 was it to change the mapping
> from Java objects to MySQL types by editing the db.props in templates.
> There I've changed the BIT to TINYINT and everything was fine.
>
> Now in Torque 3.2 it seems to me, that this db.props file is no longer
> supported. Is this correct? Why? And what can I do to get Java boolean
> Object but a MySQL tinyint?
>
> The db.props also contains the table type (here InnoDB) settings. Where
> can I set the table type in Torque 3.2 now?
>
> Bye
> Thoralf
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
>


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


Mime
View raw message