Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Developer
Posts: 11
Registered: ‎12-06-2009
My Device: Not Specified
Accepted Solution

How to exclude field for Persistable object

Hi,

 

Is there a way to override the way the PersistanceStore persist objects?

 

I've a complex data structure that I need to store. One of the inner classes contain non persistable field. When I storing the data I do not need to store this field but the compiler raise error.

 

...Widget: Error!: Class ...Widget marked Persistable by interface: ...Persistable is not Persistable: field _field: Class ...Field does not implement net.rim.vm.Persistable

 

Is the a way to override this class persitant implementation and exclude problematic fields?

Developer
Posts: 16,997
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: How to exclude field for Persistable object

create a persistable and a nonpersistable version and convert the objects on read/write

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Highlighted
New Developer
Posts: 11
Registered: ‎12-06-2009
My Device: Not Specified

Re: How to exclude field for Persistable object

Thanks for the reply.

I done something similar, I created a data class for the persistence and a runtime class with the additional fields.

This is not very convenient as these classes are deep in a complex data tree but I guess this is how it should work with BlackBerry.