- Account existingAccount = getByNameSync(account.getProfileId(), account.getName());
- if (existingAccount != null) {
- existingAccount.setGeneration(account.getGeneration());
- account = existingAccount;
- updateSync(account);
- }
- else {
- long accountId = insertSync(account);
- account.setId(accountId);
- }