ac.setCreationdate(creationdate);
ac.setLastlogin(creationdate);
ac.setLogincount(0);
ac.setLogoutcount(0);
ac.setOpenbalance(balance);
Accountprofile ap = new Accountprofile();
ap.setUserid(userid);
// Password is same as that of the userid
ap.setPasswd(userid);
ap.setAddress(userid + " address");
ap.setEmail(userid + "@nanotrader.com");
ap.setFullname("first_" + userid + " " + "last " + userid);
ap.setCreditcard("1111222233334444");
Set<Account> accounts = new HashSet<Account>();
accounts.add(ac);
ap.setAccounts(accounts);
tradingService.saveAccountProfile(ap);
Order o = new Order();
o.setAccountid((tradingService.findAccountByProfile(ap)).getAccountid());
o.setCompletiondate(creationdate);
o.setQuantity(new BigDecimal(1000));