public AccountDataBean register(String userID, String password, String fullname, String address, String email, String creditcard, BigDecimal openBalance) { AccountDataBean account = null; AccountProfileDataBean profile = null; if (Log.doTrace()) Log.trace("TradeSLSBBean:register", userID, password, fullname, address, email, creditcard, openBalance); // Check to see if a profile with the desired userID already exists profile = entityManager.find(AccountProfileDataBean.class, userID); if (profile != null) { Log.error("Failed to register new Account - AccountProfile with userID(" + userID + ") already exists"); return null; } else { profile = new AccountProfileDataBean(userID, password, fullname, address, email, creditcard); account = new AccountDataBean(0, 0, null, new Timestamp(System.currentTimeMillis()), openBalance, openBalance, userID); profile.setAccount(account); account.setProfile(profile); entityManager.persist(profile); entityManager.persist(account); } return account; }
account = new AccountDataBean(0, 0, null, new Timestamp(System.currentTimeMillis()), openBalance, openBalance, userID); profile.setAccount(account); account.setProfile(profile);
account = new AccountDataBean(0, 0, null, new Timestamp(System.currentTimeMillis()), openBalance, openBalance, userID); profile.setAccount(account); account.setProfile(profile);
public AccountDataBean register(String userID, String password, String fullname, String address, String email, String creditcard, BigDecimal openBalance) { AccountDataBean account = null; AccountProfileDataBean profile = null; if (Log.doTrace()) Log.trace("TradeSLSBBean:register", userID, password, fullname, address, email, creditcard, openBalance); // Check to see if a profile with the desired userID already exists profile = entityManager.find(AccountProfileDataBean.class, userID); if (profile != null) { Log.error("Failed to register new Account - AccountProfile with userID(" + userID + ") already exists"); return null; } else { profile = new AccountProfileDataBean(userID, password, fullname, address, email, creditcard); account = new AccountDataBean(0, 0, null, new Timestamp(System.currentTimeMillis()), openBalance, openBalance, userID); profile.setAccount(account); account.setProfile(profile); entityManager.persist(profile); entityManager.persist(account); } return account; }
public AccountDataBean register(String userID, String password, String fullname, String address, String email, String creditcard, BigDecimal openBalance) { AccountDataBean account = null; AccountProfileDataBean profile = null; if (Log.doTrace()) Log.trace("TradeJPADirect:register", userID, password, fullname, address, email, creditcard, openBalance); // Check to see if a profile with the desired userID already exists profile = entityManager.find(AccountProfileDataBean.class, userID); if (profile != null) { Log.error("Failed to register new Account - AccountProfile with userID(" + userID + ") already exists"); return null; } else { profile = new AccountProfileDataBean(userID, password, fullname, address, email, creditcard); account = new AccountDataBean(0, 0, null, new Timestamp(System.currentTimeMillis()), openBalance, openBalance, userID); profile.setAccount(account); account.setProfile(profile); /* * managed Transaction */ entityManager.persist(profile); entityManager.persist(account); } return account; }
public AccountDataBean register(String userID, String password, String fullname, String address, String email, String creditcard, BigDecimal openBalance) { AccountDataBean account = null; AccountProfileDataBean profile = null; if (Log.doTrace()) Log.trace("TradeJPADirect:register", userID, password, fullname, address, email, creditcard, openBalance); // Check to see if a profile with the desired userID already exists profile = entityManager.find(AccountProfileDataBean.class, userID); if (profile != null) { Log.error("Failed to register new Account - AccountProfile with userID(" + userID + ") already exists"); return null; } else { profile = new AccountProfileDataBean(userID, password, fullname, address, email, creditcard); account = new AccountDataBean(0, 0, null, new Timestamp(System.currentTimeMillis()), openBalance, openBalance, userID); profile.setAccount(account); account.setProfile(profile); /* * managed Transaction */ entityManager.persist(profile); entityManager.persist(account); } return account; }