Skip to content

Instantly share code, notes, and snippets.

@cosbor11
Created July 5, 2016 13:42
Show Gist options
  • Save cosbor11/26896c3521967435c4f598efd562ed6c to your computer and use it in GitHub Desktop.
Save cosbor11/26896c3521967435c4f598efd562ed6c to your computer and use it in GitHub Desktop.
Showcase how the Account entity has been changed including added and removed attributes
// Fetch an account. Notice that the id is now a long rather than an integer.
Account account = (Account)persistenceManager.findById(Account.class, 1l);
assert account.getAccountId() == 1l;
// The Account Name is a new field and is now persistable.
// This demonstrates that we can now take
// advantage of the new field.
account.setAccountName("Utility Bill");
persistenceManager.saveEntity(account);
// Verify it was indeed persisted
account = (Account)persistenceManager.findById(Account.class, 1l);
assert account.getAccountName().equals("Utility Bill");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment