I'm using PS to store data in my app. I think I have a misunderstanding of how PS works. If anyone could tell me how to make it so that the bill I retrieve from PS is unencrypted as opposed to the encrypted bill I end up with? Note: I originally store and unencrypted bill!
From what I can tell, it considers both bills, and both PO objects to be the same objects! When I look at their memory locations in Eclispe, both bill and both PO objects have identical memory locations! What am I missing?
Thanks!
//create an unencrypted bill
BillDAO testBill = new BillDAO();
//store it in PS
PersistentObject po = PersistentStore.getPersistentObject(4);
po.setContents(testBill);
po.forceCommit();
//encrypt the bill
testBill.encrypt();
//retrieve it from PS using a different PO
PersistentObject po2 = PersistentStore.getPersistentObject(4);
BillDAO retrievedBill = (BillDAO) po2.getContents();
//and now for some reason my retrieved bill is encrypted!
//it should be unencrypted