When building your own, you could specify it.  I just started
considering this problem a few minutes ago in relation to torque and the
current scarab schema. (Good timing.)

The easiest answer is for tables that have one primary key defined; the
pk column gives the id.

Having had the benefit of being able to assign a single column pk to any
table, I would give any table that corresponded to an object a single
column pk.  I did not generally build objects for join type tables. 
Torque does not distinguish and I suppose there could be benefits to
creating objects for join type tables.  I think I am going to need to
create a true OID class that will be used as the id object.  My solution
after a couple minutes thought is to extend or build around a TreeMap
with keys being the pk column names and values being the pk values.  The
toString() could give something like 121:2:45888 as the id where the
separator can be set.  So that the id representation does not have to
contain the key names I will add a String vector to the Peers that
defines the order.

Anyone with some quick suggestions as I am going to start working on
this now.

John McNally

Sean Legassick wrote:
> 
> What is the relationship between BaseObject.id and the autoincrementing ID
> I declare in the schema? Looking at turbine-schema.xml and the example
> project-schema.xml it seems intended that tables name their ID columns
> XXX_ID rather than just ID. How does this value then find its way into
> BaseObject.id?
> 
> --
> Sean Legassick
> [EMAIL PROTECTED]
>                                   homo sum: humani nihil a me alienum puto
> 
> ------------------------------------------------------------
> 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