You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-user@db.apache.org by Tomáš Procházka <t....@centrum.cz> on 2006/04/12 23:52:12 UTC

jdbc -> xml problem (MySQL)

Hi.

I'm use Torque only one day and it's perfect project. I looking for it for long time.

But I found one problem in Generator. I use MySQL 5 database. I created table with this SQL:

DROP TABLE IF EXISTS `car_type`;
CREATE TABLE IF NOT EXISTS `car_type` (
  `id` mediumint(9) NOT NULL,
  `value` varchar(20) collate utf8_czech_ci default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;

and Generator create this:

 <table name="car_type">
     <column default="" name="id" primaryKey="true" required="true" type="INTEGER"/>
     <column name="value" size="20" type="VARCHAR"/>
 </table>

Problem is in default="". INTEGER type can not have empty string default value "".  This cause problem while generating java code.

Is this bug in Torgue or MySQL or JDBC driver?

Also it's pity that it doesn't support comment of column or table, references integrity attributes (ON DELETE CASCADE or ON UPDATE CASCADE), support for Java 1.5. It's something from them in plan for future version?

-- 
Tomas Prochazka


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


Re: jdbc -> xml problem (MySQL)

Posted by Tomáš Procházka <t....@centrum.cz>.
Hi,

   OK. Issue number is: TRQS353

-------------------------- Original message --------------------------
       From: Thomas Fischer <fi...@seitenbau.net>
    Subject: jdbc -> xml problem (MySQL)
       Date: Thursday, April 13, 2006, 11:46:11 AM
Attachments: <none>
      msgid:OF693B84AB.A4AC8E40-ONC125714F.0033220D-C125714F.0035AB1C@seitenbau.net

T> This looks like a bug in the jdbc2xml task. Can you create an issue in the
T> issue tracker please ?
----------------------- End of original message ----------------------

-- 
 Tomas Prochazka


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


Re: jdbc -> xml problem (MySQL)

Posted by Tomáš Procházka <t....@centrum.cz>.
Hi.

>> Attempting to download jdbc-2.0.jar.
>> WARNING: Failed to download jdbc-2.0.jar.
>> Attempting to download jndi-1.2.1.jar.
>> WARNING: Failed to download jndi-1.2.1.jar.

T> Maven cannot download these automatically because you need to agree
T> explicitly to Sun's license agreement. But if you use java 1.4 or later,
T> you can omit these dependencies (i.e throw them out of the pom).
T> Alternatively, you can download the jars and put them in your maven
T> repository.

 Thanks you, it's work now. Java version would be better solution ;-)

>> I try used torque-gen-templates-3.2.1-dev.jar and torque-gen-3.2.1-
>> dev.jar from svn trunk and no Java 1.5 generics found in generated
>> source code :-(

T> You have to enable it, it is not turned on by default. Build the site from
T> svn and look in the properties documentation.

 Yes. Sorry.
  
----------------------- End of original message ----------------------

-- 
 Tomas Prochazka


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


Re: jdbc -> xml problem (MySQL)

Posted by Thomas Fischer <fi...@seitenbau.net>.
Tomáš Procházka <t....@centrum.cz> schrieb am 13.04.2006 12:35:13:

> I download latest SVN a try it compile. But I doesn't have
> experience with Maven before. I install Maven 2, then I find out
> that Torque need Maven 1. I install Maven 1, run maven  build in
> root directory, it's doesn't work, then I run maven install ant its
> work :-) Only runtime doesn't compile because:
>
> Attempting to download jdbc-2.0.jar.
> WARNING: Failed to download jdbc-2.0.jar.
> Attempting to download jndi-1.2.1.jar.
> WARNING: Failed to download jndi-1.2.1.jar.

Maven cannot download these automatically because you need to agree
explicitly to Sun's license agreement. But if you use java 1.4 or later,
you can omit these dependencies (i.e throw them out of the pom).
Alternatively, you can download the jars and put them in your maven
repository.

> I try used torque-gen-templates-3.2.1-dev.jar and torque-gen-3.2.1-
> dev.jar from svn trunk and no Java 1.5 generics found in generated
> source code :-(

You have to enable it, it is not turned on by default. Build the site from
svn and look in the properties documentation.

   Thomas

Re: jdbc -> xml problem (MySQL)

Posted by Tomáš Procházka <t....@centrum.cz>.
Hi.

T> This looks like a bug in the jdbc2xml task. Can you create an issue in the
T> issue tracker please ?

I try it.

T> Java 1.5 support is already in SVN. You may want to build from SVN.
T> It also supports comment on column/table for some databases, but I cannot
T> remember whether in 3.2 or in SVN only.

I download latest SVN a try it compile. But I doesn't have experience with Maven before. I install Maven 2, then I find out that Torque need Maven 1. I install Maven 1, run maven  build in root directory, it's doesn't work, then I run maven install ant its work :-) Only runtime doesn't compile because:

Attempting to download jdbc-2.0.jar.
WARNING: Failed to download jdbc-2.0.jar.
Attempting to download jndi-1.2.1.jar.
WARNING: Failed to download jndi-1.2.1.jar.

I try used torque-gen-templates-3.2.1-dev.jar and torque-gen-3.2.1-dev.jar from svn trunk and no Java 1.5 generics found in generated source code :-(

T> Cascading is something I have to look into; there are no current plans I am
T> aware of. It is not supported natively by all databases, so we might have
T> to do it manually for databases which do not support it, and this might be
T> problematic.

Support only for databases which be able to use cascading will be adequate.

But I thing, that is not problem, when I use this system on the database which use cascading. I only must use own SQL script (not generated with Generator).
  

-------------------------- Original message --------------------------
       From: Thomas Fischer <fi...@seitenbau.net>
    Subject: jdbc -> xml problem (MySQL)
       Date: Thursday, April 13, 2006, 11:46:11 AM
Attachments: <none>
      msgid:OF693B84AB.A4AC8E40-ONC125714F.0033220D-C125714F.0035AB1C@seitenbau.net

T> Hi,



T>    Thomas

T> Tomáš Procházka <t....@centrum.cz> schrieb am 12.04.2006 23:52:12:

>> Hi.

>> I'm use Torque only one day and it's perfect project. I looking for
>> it for long time.

>> But I found one problem in Generator. I use MySQL 5 database. I
>> created table with this SQL:

>> DROP TABLE IF EXISTS `car_type`;
>> CREATE TABLE IF NOT EXISTS `car_type` (
>>   `id` mediumint(9) NOT NULL,
>>   `value` varchar(20) collate utf8_czech_ci default NULL,
>>   PRIMARY KEY  (`id`)
>> ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;

>> and Generator create this:

>>  <table name="car_type">
>>      <column default="" name="id" primaryKey="true" required="true"
>> type="INTEGER"/>
>>      <column name="value" size="20" type="VARCHAR"/>
>>  </table>

>> Problem is in default="". INTEGER type can not have empty string
>> default value "".  This cause problem while generating java code.

>> Is this bug in Torgue or MySQL or JDBC driver?

>> Also it's pity that it doesn't support comment of column or table,
>> references integrity attributes (ON DELETE CASCADE or ON UPDATE
>> CASCADE), support for Java 1.5. It's something from them in plan for
>> future version?

>> --
>> Tomas Prochazka


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

----------------------- End of original message ----------------------

-- 
 Tomas Prochazka


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


RE: jdbc -> xml problem (MySQL)

Posted by Thomas Fischer <fi...@seitenbau.net>.
Hi,

This looks like a bug in the jdbc2xml task. Can you create an issue in the
issue tracker please ?

Java 1.5 support is already in SVN. You may want to build from SVN.
It also supports comment on column/table for some databases, but I cannot
remember whether in 3.2 or in SVN only.
Cascading is something I have to look into; there are no current plans I am
aware of. It is not supported natively by all databases, so we might have
to do it manually for databases which do not support it, and this might be
problematic.

   Thomas

Tomáš Procházka <t....@centrum.cz> schrieb am 12.04.2006 23:52:12:

> Hi.
>
> I'm use Torque only one day and it's perfect project. I looking for
> it for long time.
>
> But I found one problem in Generator. I use MySQL 5 database. I
> created table with this SQL:
>
> DROP TABLE IF EXISTS `car_type`;
> CREATE TABLE IF NOT EXISTS `car_type` (
>   `id` mediumint(9) NOT NULL,
>   `value` varchar(20) collate utf8_czech_ci default NULL,
>   PRIMARY KEY  (`id`)
> ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
>
> and Generator create this:
>
>  <table name="car_type">
>      <column default="" name="id" primaryKey="true" required="true"
> type="INTEGER"/>
>      <column name="value" size="20" type="VARCHAR"/>
>  </table>
>
> Problem is in default="". INTEGER type can not have empty string
> default value "".  This cause problem while generating java code.
>
> Is this bug in Torgue or MySQL or JDBC driver?
>
> Also it's pity that it doesn't support comment of column or table,
> references integrity attributes (ON DELETE CASCADE or ON UPDATE
> CASCADE), support for Java 1.5. It's something from them in plan for
> future version?
>
> --
> Tomas Prochazka
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
>