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.
Best regards, Paulo Schlup Santos www.wiaxis.com Mobile Solutions
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]
