PS を使用してアプリにデータを保存しています。PS の仕組みを誤解していると思います。最終的に暗号化された請求書ではなく、PS から取得した請求書が暗号化されないようにする方法を誰かが教えてくれたら? 注: 私はもともと暗号化されていない請求書を保存します!
私が知る限り、両方の請求書と両方の PO オブジェクトが同じオブジェクトであると見なされます。Eclispe でそれらのメモリ ロケーションを見ると、両方の請求書オブジェクトと両方の PO オブジェクトのメモリ ロケーションが同じです。私は何が欠けていますか?
ありがとう!
//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