Hi,

I need to use Oracle as DB. Before, I used mySQL.
I want to use sequences to deal with autoincrement. So in the
MapBuilders, I used setPrimaryKeyMethod(TableMap.SEQUENCE); But I don't
know how to tell Turbine to use the sequence I want.

This is a part of my MapBuilder. I would like to have the Company_sid
autoincremented by a sequence named seq_company_sid

   public void doBuild ( ) throws Exception
    {
        String string = new String("");
        Integer integer = new Integer(0);
        java.util.Date date = new Date();

        dbMap = PoolBrokerService.getInstance()
            .getDatabaseMap(PoolBrokerService.DEFAULT);

        dbMap.addTable(getTable());
        TableMap tMap = dbMap.getTable(getTable());
        tMap.addPrimaryKey ( getCompany_CompanySid(), integer );
        tMap.setPrimaryKeyMethod(TableMap.SEQUENCE);

        tMap.addColumn ( getCompany_Name(), string );
        tMap.addColumn ( getCompany_Comment(), string );
.......
}

I think I should use the setSequenceInfo(Object), but I don't know what
to put as object.

Any suggestions or doc to read are welcome.

Thanks,

Julien



------------------------------------------------------------
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