This will add wrong information for when the database uses autoincrement
for its native method. It is probably harmless in this case, but I
would prefer the patch include a check that the database actually needs
this data before it is added.
-0
john mcnally
Dan Finkelstein wrote:
>
> Hi --
>
> I found out what the underlying problem was...in the move from "sequence" to
> "native" as the preferred default, a velocity template file wasn't updated.
> templates/om/MapBuild.vm should include these two lines after line 99:
>
> #elseif ($table.IdMethod == "native")
> tMap.setPrimaryKeyMethodInfo("$table.SequenceName");
>
> Could something with write access please update the torque tree?
> Thanks,
> Dan
>
> -----Original Message-----
> From: Dan Finkelstein
> Sent: Monday, October 15, 2001 10:16 AM
> To: '[EMAIL PROTECTED]'
> Subject: RE: Torque: Oracle with idMethod as "native"
>
> I tried this, but got the same error:
>
> java.sql.SQLException: ORA-00923: FROM keyword not found where
> expected
>
> at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:114)
> at oracle.jdbc.oci8.OCIDBAccess.check_error(OCIDBAccess.java:1503)
> at
> oracle.jdbc.oci8.OCIDBAccess.parseExecuteDescribe(OCIDBAccess.java:735)
> at
> oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java:1600)
> at
> oracle.jdbc.driver.OracleStatement.doExecute(OracleStatement.java:1758)
> at
> oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java
> :1805)
> at
> oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:410)
> at
> com.workingdogs.village.QueryDataSet.<init>(QueryDataSet.java:112)
> at
> org.apache.torque.oid.SequenceIdGenerator.getIdAsVillageValue(SequenceIdGene
> rator.java:190)
> at
> org.apache.torque.oid.SequenceIdGenerator.getIdAsBigDecimal(SequenceIdGenera
> tor.java:126)
> at org.apache.torque.util.BasePeer.doInsert(BasePeer.java:793)
> at org.apache.torque.util.BasePeer.doInsert(BasePeer.java:695)
> at
> com.bluescope.pl.tables.BaseServerblobPeer.doInsert(BaseServerblobPeer.java:
> 128)
> at
> com.bluescope.pl.tables.BaseServerblobPeer.doInsert(BaseServerblobPeer.java:
> 114)
> at
> com.bluescope.pl.tables.BaseServerblobPeer.doInsert(BaseServerblobPeer.java:
> 348)
> at com.bluescope.pl.AssetPL.addServerBlob(AssetPL.java:192)
> at com.bluescope.pl.AssetPL.main(AssetPL.java:351)
>
> The sql request being passed to JDBC is "select null.nextval from dual"
> instead of "select company_seq.nextval from dual". It looks like the
> low-level code isn't able to retrieve COMPANY_SEQ --
>
> Dan
>
> -----Original Message-----
> From: John McNally [mailto:[EMAIL PROTECTED]]
> Sent: Friday, October 12, 2001 10:45 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Torque: Oracle with idMethod as "native"
>
> have you tried specifying the idMethod directly on the table tag
>
> <table name="COLUMN" idMethod="native" ...
>
> does that lead to the same error?
>
> john mcnally
>
> Dan Finkelstein wrote:
> >
> > Sure, here is how my xml schema for the COMPANY table. Thanks!
> >
> > <app-data>
> > <database
> > defaultIdMethod="native"
> > >
> >
> > <table name="COMPANY">
> > <column name="ID" required="true" autoIncrement="true"
> > primaryKey="true" type="INTEGER"/>
> > <column name="NAME" required="true" size="255" type="VARCHAR"/>
> > <column name="GLOBALXML" required="true" size="255" type="VARCHAR"/>
> > <column name="UPDATED" required="true" type="TIMESTAMP"/>
> > </table>
> >
> > </database>
> >
> > </app-data>
> >
>
> ---------------------------------------------------------------------
> 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]
>
> ---------------------------------------------------------------------
> 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]