InitialContext ctx = new InitialContext();
CMPFindTestEntityHome home = (CMPFindTestEntityHome)ctx.lookup("CMPFindTestEntity");
AddressHome addrHome = (AddressHome)ctx.lookup("Address");
for (int i=0;i<DATASET_SIZE;i++) {
String key = Long.toString(System.currentTimeMillis())+"-"+i;
CMPFindTestEntityRemote rem = home.create(key);
rem.setName("Name");
rem.setRank("Rank");
rem.setSerialNumber("123456789");
//give him an address
if ((i % 2) ==0) {
addrHome.create(rem.getKey(), "1", "123 east st.", "Eau Claire", "WI", "54701");
} else {
addrHome.create(rem.getKey(), "1", "123 east st.", "Milwaukee", "WI", "54201");
}
}
} catch (Exception e) {
log.debug("Exception caught: "+e);
log.debug("failed", e);