db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kasala, Satish" <skas...@profilesys.com>
Subject RE: obtaining native primary keys problem
Date Thu, 27 Feb 2003 14:06:29 GMT
Hi Glen,
doInsert() method on the Peer object returns a ObjectKey. Use the ObjectKey
to retrieve the value of the native ID.

Satish

-----Original Message-----
From: Trudgett, Glen [mailto:Glen.Trudgett@det.nsw.edu.au] 
Sent: Wednesday, February 26, 2003 7:38 PM
To: 'Turbine Torque Users List'
Subject: RE: obtaining native primary keys problem

Jim,

I have also tried this method.

I know the primary key value is 621, but the method still returns 0!

Glen

-----Original Message-----
From: Jim Schneider [mailto:jschneider@kjinteractive.com] 
Sent: Thursday, 27 February 2003 11:39 AM
To: Turbine Torque Users List
Subject: Re: obtaining native primary keys problem


Glen,

I haven't tried the methods you mention. I usually just call the 
accessor for the primary key field.

That is,

test.insert();
int pk = test.getId();  // assuming the primary key field name is "id" 
in the schema.xml file

I'm assuming that this is not what you're looking for, but I thought I'd 
just mention it anyway.

Jim

Trudgett, Glen wrote:

>To All,
>
>
>I currently have an Oracle DB that I am using for my data.
>
>I have set my tables to have natively generated primary keys, which 
>works fine.
>
>I do an insert of information into a table, and the table happily 
>accepts the data, as expected.
>
>test.insert("blah");
>
>Table
>1, blah
>
>When I try to obtain the primary key for this new entry, which I want 
>to use to populate a foreign key link table, using
>
>Test.getPrimaryKey();
>
>I receive a value of 0. (Not the value of 1 or whatever number it is
>allocated!!)
>
>I can not work out why I can not get these values. I have tried a 
>number of ways e.g. getbyname(), getPrimaryKey().
>
>Also I have noticed that the getPrimaryKeyas* functions are not 
>available.
>
>Has anybody run into a similar scenario?
>
>TIA
>
>
>
>Glen Trudgett
>Unix system administration 
>Information Technology Bureau 
>Department of Education and Training 
>Level 2, 39A Herbert St, St Leonards, NSW 2065 Australia 
>Tel: 61+ (2) 99429970 Fax: 61+ (2) 99429600 
>
>**********************************************************************
>This message is intended for the addressee named and may contain 
>privileged information or confidential information or both. If you are 
>not the intended recipient please delete it and notify the sender.
>**********************************************************************
>
>**********************************************************************
>This message is intended for the addressee named and may contain 
>privileged information or confidential information or both. If you are 
>not the intended recipient please delete it and notify the sender.
>**********************************************************************
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
>For additional commands, e-mail: torque-user-help@db.apache.org
>
>
>  
>

-- 
Jim Schneider
KJ Interactive, Inc.
303-765-1357
www.kjinteractive.com





---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org

**********************************************************************
This message is intended for the addressee named and may contain
privileged information or confidential information or both. If you
are not the intended recipient please delete it and notify the sender.
**********************************************************************

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org

Mime
View raw message