db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ferruh Zamangoer" <ferruh.zamang...@gistec-online.de>
Subject AW: AW: defaultIdMethod="none"
Date Tue, 31 Aug 2004 10:16:10 GMT
Okay I have understand what you mean. But the Problem is that I want only to
know what the actual Primary Key is, when I'am calling a select then I
become all Hits from the database. For example

	Criteria criteria = new Criteria();
	criteria.add(AddressB322Peer.ADMINAREA, "FRA");
	AddressB322Peer.doSelect(criteria);

But it could be that I have 10 hits with the same ADMINAREA Code, how do I
know which is the last dataset ???

Or can you give some example ???

Regards
Ferruh


-----Urspr√ľngliche Nachricht-----
Von: Andras Balogh [mailto:andras@reea.net]
Gesendet: Dienstag, 31. August 2004 11:45
An: Apache Torque Users List
Betreff: Re: AW: defaultIdMethod="none"


Hello,

    I think when you are using idMethod="none" torque know that you are
in charge of setting the primary key
values and doesn't try to set them.
What you have to do is to do a select on  AddressB322Peer after insert
to get it back your AddressB322
also with the ID inserted by  your trigger than you can use it later for
referencing.

Best regards,
Andras.

Ferruh Zamangoer wrote:

>Sorry I have seen that the data is inserted into the AddressB322 table
>correctly, but how can I set the references to the table  AddressDelpoint,
>AddressEmailadd. My understanding is that the data is inserted correctly by
>the underlying database, but the ab322 Object becomes no data back or have
>not the actual primaryKey???
>
>
>
>	AddressB322 ab322 = new AddressB322();
>	ab322.setAdminarea("FRA");
>	ab322.setCity("Frankfurt" +  System.currentTimeMillis());
>	ab322.setCountry("Hessen");
>	ab322.setPostcode("60313");
>	AddressB322Peer.doInsert(ab322);
>
>	AddressDelpoint ad = new AddressDelpoint();
>	ad.setAddressB322(ab322);				//references
>	//ad.setIdaddress(ab322.getIdaddress());
>	ad.setDelpoint("Frankfurt");
>	ad.save();
>
>	AddressEmailadd aed = new AddressEmailadd();
>	aed.setAddressB322(ab322);				//references
>	//aed.setIdaddress(ab322.getIdaddress());
>	aed.setEmailadd("ferruh.zamangoer@gistec-online.de");
>	aed.save();
>
>
>
>
>
>
>
>
>
>


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


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