01-16-2009 06:41 AM
i am using JDE 4.7 with storm simulator
i am developing favourite app
i can add things to favourite list
but i can not delete from that list
first i create the persistent object with one specified ID
then i use setContent method to add into list
i am adding Vector type object
for deleting item from the list, i get contents from the persistent store object
then delete the particular item and rebuild the vector and then add it to store object
but this will not work as in store object, i have to clear previous contents
then can add newly rebuilded vector
but i do not know how to reset or clear persistent object without changing it;s long hexadecimal ID
please help me
01-16-2009 07:10 AM - edited 01-16-2009 07:17 AM
You can use "destroyPersistantObject" method of "PersistentStore". Use the same ID and create persitent object.
01-16-2009 07:36 AM - edited 01-16-2009 07:36 AM
What error did you get ?
If you use the same unid to store the object the previous object will be rewritten.
It is not necessary to delete the object.
Also I recommend to create a wrapper class that contains Vector and store/load this class.
Otherwise your persistent data will remain on device memory when your application uninstalled.