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: defaultIdMethod="none"
Date Tue, 31 Aug 2004 13:01:52 GMT
Hi,

I found a way to insert the references, if anybody is interested here is the
code:

AddressB322 ab322 = new AddressB322();
ab322.setAdminarea("FRA");
ab322.setCity("Frankfurt" +  System.currentTimeMillis());
ab322.setCountry("Hessen");
ab322.setPostcode("60313");
ab322.save();

List list = AddressB322Peer.executeQuery("SELECT MAX(IDADDRESS) from
ADDRESS_B322");
Record primaryKey = new Record();

if(list.size()!=0)
{
 primaryKey = (Record)list.get(0);
}

String pk = primaryKey.toString();
int begin = pk.indexOf("'");
int end = pk.lastIndexOf("'");
String uniquePrimaryKey = pk.substring(begin+1, end);

ab322.setIdfreetext(Integer.parseInt(uniquePrimaryKey));

AddressDelpoint ad = new AddressDelpoint();
ad.setAddressB322(ab322);
ad.setDelpoint("Frankfurt");
ad.save();

AddressEmailadd aed = new AddressEmailadd();
aed.setAddressB322(ab322);
aed.setEmailadd("ferruh.zamangoer@gistec-online.de");
aed.save();


I think it's not the best way but it work :)

Regards
Ferruh


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