Created
July 5, 2016 13:42
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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