Hi Bartek,
I have seen something like this happen in PostgreSQL, but on Oracle it's working just fine for us. Did you try cleaning your target directory with "maven clean" and building your app again? I've found out that it solves many problems with inconsistencies among torque classes.
The only other thing I can tell you is that we have put tne idMethod="true" on both dataset and table xml tags, and that the uppercase "M" *does* matter in the "idMethod" keyword. Also, the keywords "autoIncrement" and "primaryKey" should be type exactly as I've put below, with capital "I" and "K" respectively.
Best Regards, Paulo Schlup Santos Wiaxis.com mobile solutions
Bartek Walter wrote:
Paulo Schlup Santos wrote:
Hi Bartek,
I have found out that you also need to add the statement "autoIncrement=true" to the primary key column for the *native* id method to work. Below is an example extracted from our schema file:
<column name="CLIENTE_ID" required="true" autoIncrement="true" primaryKey="true" type="INTEGER"/>
This project uses Oracle 9i as a database and the auto-increment columns work just fine with the above line, with no modifications to the mapping classes whatsoever.
Thank you, Paulo, very much.
Unfortunately your advice seem not to be working for me :( It seems to me that autoIncrement attribute turns on and off generation of PKs, but it does not switch the idMethods (but perhaps I am wrong - did you encounter such behavior?).
Even if I set up the 'native' idMethod in the schema, the application uses idbroker (and IDs get incremented properly, but from ID_TABLE). I checked the databaseMap at runtime, and all tables are registerd there, but with improper idMethod data.
On one hand it seems that *MapBuilder.doBuild() methods get called (somhow the databaseMap is initialized with 'idbroker'), but on the other I have to call them manually within the application to set 'natives', just like if it loaded other MapBuilders(). I still have no idea what the reason could be for that.
Did you change any Turbine settings?
Best regards, Bartek
Bartek Walter wrote:
hello,
I got a problem, possibly with a trivial solution, but I stuck in it and cannot get out:
I use TorqueSecuritySchema and I modified the turbine-security-schema.xml to use the 'native' idMethod. The method is defined both at the database and tables level:
<database name="foo" defaultIdMethod="native" defaultJavaType="primitive" defaultJavaNamingMethod="underscore" package="@DATABASE_PACKAGE@">
<table name="TURBINE_USER" idMethod="native"> ... </table> </database>
The Peers and TableMapBuilders are generated correctly, ie. with 'native' as primary key method, also .sql files contain sequence definitions (I use Oracle).
The problem is that the application uses idbroker instead of native. The DatabaseMap is initialized with TableMapBuilders (their isBuild() methods return 'true' also) , but with wrong primary key method settings ('idbroker', incorrect sequence name). It is strange, since the default value for idMethod is 'none', so that the TableMapBuilder must have been built before.
After manual adjusting the values by manipulating on DatabaseMap prior to executing any insert to the TURBINE_USER table, Torque begins to use natives.
The security schema and application schemas reside in separate files, but they share a common database name. I use TorqueUser as implementation object, and Torque-generated peer/entity objects.
Any idea what the problem could be?
Best regards,
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
