Hi:

I am using tdk 1.0a9

I config the xml as Jon suggested like this:

          <table name="LOCAL_CONTENT" idMethod="autoincrement">
                    <column name="ID" primaryKey="true" type="INTEGER"/>
                    <column name="COMPANYID" required="true" type="INTEGER"/>
                    <column name="CODE" required="true" size="11" type="VARCHAR"/>
                    <column name="ORENTATION" required="true" size="2" type="VARCHAR"/>
                    <column name="CONTENT" type="BLOB"/>
                    <column name="STATUS" size="2" type="VARCHAR"/>
                    <column name="LAST_MODIFIED" null="false" size="19" 
type="VARCHAR"/>
          </table>


After using torque.sh,  I find in LocalContentMapBuilder.java:

                tMap.setPrimaryKeyMethod(TableMap.IDBROKERTABLE);

It still using IDBROKERTABLE, not autoincrement.


Regards

fanyun







-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of Jon Stevens
Sent: Monday, January 01, 2001 5:19 AM
To: Turbine
Subject: Re: How to turn off ID_Broker


on 12/31/2000 12:31 PM, "Daniel Rall" <[EMAIL PROTECTED]> wrote:

> The only IDBroker property that I see is cleverquantity.

Ok. I apologize.

So, I read the source code to BasePeer.doInsert():

        String keyMethod = tableMap.getPrimaryKeyMethod();

            // If the keyMethod is SEQUENCE or IDBROKERTABLE, get the id
            // before the insert.
            if (keyMethod.equals(TableMap.SEQUENCE))
            {
                id = dbMap.getIDBroker()
                    .getNextSequenceId(tableMap.getPrimaryKeyMethodInfo());
            }
            else if (keyMethod.equals(TableMap.IDBROKERTABLE))
            {
                id = dbMap.getIDBroker().getNextId(tableName);
            }

You need to create a TableMap who's primaryKeyMethod() is SEQUENCE instead
of IDBROKERTABLE. This is done by editing your project-schema.xml file to
have:

<table name="foo" idMethod="autoincrement">

However, I suggest that you always use IDBroker instead.

-jon

--
Honk if you love peace and quiet.



------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]




------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]

Reply via email to