db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ron piterman <ron.piter...@gmx.net>
Subject Re: IdGenerator is null
Date Tue, 13 Jul 2004 10:26:17 GMT
The problem is, the OM is not useable (will not compile):
I have to remove some ")" which are just there out of the blue, I have 
to add cast byte 0s to bytes, I have to remove some
new Date(00-00-00 00-00-0000) which naturally does not compile, and so on.
My work flow at the moment is:

Change Database (schema)
generate torque schema
--> correct this schema manually (like remove the 00-00-00...), add 
auto-increment="true" on ids aso
generate OM
--> correct the OM manually

I guess the problems are from a incompatibility or lack of 
implementation in the jdbc mysql driver, which perhaps does not supply 
full schema information.

Greetings,
Ron


Cameron Hickey wrote:

>Torque does not need the schema file to function, only for the
>generation tasks.
>
>In the build-torque.xml file from pre-3.1 builds, there are some tasks
>which I used originally which I believe solved the problem you are
>having...
>
>Id-table-init-sql (which I think does the same thing as creating the ID
>table someone else suggested you create)
>
>I have used torque to generate a DB and OM files after writing out the
>schema files, and I have alternatively used an existing DB to generate
>the schema via the JDBC task.
>
>Using this second method that you are using, I have found considerable
>difficulty getting things to work properly.  I had to make numerous
>adjustments to the schema file to get it to generate OM classes which
>actually worked with the database.  After all the problems, I decided
>this was not an ideal method of working and dropped it. Although I am
>sure this is not an available course of action, perhaps you can test a
>workaround... and then see where the problems might lie:
>
>Try taking your autogenerated schema file, and using it to generate a
>new set of SQL statements to build a new database.  If this SQL works
>without errors to create a new db and tables, then try to use your
>generated OM classes on that DB.  If that works, you can deduce that
>something is not working properly in the JDBC translation from your
>original database to the schema file.  I know this sounds tedious, but
>it may at least start you on the path to finding a solution, since the
>errors returned by all aspect of torque tend to be completely opaque or
>worse entirely misleading.
>
>Cameron
>
>  
>
>>-----Original Message-----
>>From: ron piterman [mailto:ron.piterman@gmx.net]
>>Sent: Tuesday, July 13, 2004 12:59 PM
>>To: Apache Torque Users List
>>Subject: Re: IdGenerator is null
>>
>>Does Torque needs my Schema to do IDs? Also after I generate the
>>    
>>
>Object
>  
>
>>Model? because Currently it has no access to the schema file.
>>(I can hardly imagine this is happening, since in the properties or in
>>the configuration method, there is no reference to the schema file,
>>    
>>
>so,
>  
>
>>suppose torque needs it, how would it find it?)
>>Cheers, and thanx - I will try it now...
>>Ron
>>
>>
>>Andras Balogh wrote:
>>
>>    
>>
>>>Hello,
>>>
>>>I think you should try to add 2 things in your schema file and
>>>regenerate the OM classes:
>>>1. add autoIncrement="true" for each column that is autoincrement
>>>(address_book_id,customers_id)
>>>2. try to specify the DB name is the schema also like <database
>>>name="tutim"
>>>
>>>Hope it helps a bit,
>>>Andras.
>>>
>>>
>>>      
>>>
>---------------------------------------------------------------------
>  
>
>>>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
>>    
>>
>
>
>---------------------------------------------------------------------
>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