FYI:

Since I've now started having time to mess with Torque/Peers, I've stumbled
a bit and had to make some minor changes.  We are using Sybase and thinking
these changes would be useful, I've thrown them into a patch.  The patch
file is on http://sites.netscape.net/ekkerbj

*) In the sql templates for Sybase, switched the ; to GO since we have
problems with this and it is standard in isql to use GO.

*) Updated some types in db.props for Sybase

*) I had a table with two fields being the primary key.  One field is a
foreign key into another table ( INTEGER ) and the other is a VARCHAR.  In
the generated peer class, it was assuming that all primary keys are
auto-incremented.  So I made changes to buildCriteria() and doInsert().  In
BuildCriteria() the check for !isNew() is only done if the primary key is
set to auto-increment.  In doInsert() where the setId() method is called, I
now check that BasePeer.doInsert() doesn't return a null, as in the case
where the primary keys are not auto-incremented, and only set the key then.


All seems to work here, but since this is my first real peer/torque stuff, I
just put the patch up for review before committing.

Comments?

One other question I couldn't find a defintive answer for in the mail
archives.  Does the peer system require at least one column to be defined as
a primary key?  In one of our tables we have no primary keys, the sql
generated for sybase still puts the CONSTRAINT line in, but there are no
fields.  I haven't looked into the om generated code much, but
buildCriteria() looks ok, and the above changes for doInsert should work,
but there are still methods for retrievePK()?  Will keep looking, but just
thought I'd ask.

jb


------------------------------------------------------------------------

This message has been scanned for viruses with Trend Micro's Interscan VirusWall.


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