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
Regular Contributor
Posts: 52
Registered: ‎10-31-2010
My Device: Not Specified
My Carrier: developer

Persistent object

Hi,

I'm using persistent object to store some data fields.

how can i create relationship between two classes which they need to sotre details in one object ?

 

Will it be possible ?

 

At the same time is it possible to access to application to share a stored data ?

 

In midlets we can use one recordstore for two applications. Is there any similar way in blackberry ?

 

Can anybody help me on this ?

 

Thanks in advance.

Contributor
Posts: 47
Registered: ‎02-20-2009
My Device: Torch
My Carrier: AT&T

Re: Persistent object

When you open your persistent object, you'll just open the same location for both apps. While this method works our for you, it's also a security "issue":

 

PersistentObject rec = PersistentStore.getPersistentObject(PersistentKey);

 

Leaving the PersistentKey the same between two apps will "share" the data. If you wanted more, you could do Code Signing and sign the two apps with the same key...at least I think...


--Lee

---
LVM Engineering, Inc.
www.LVMEngineering.com

Don't forget to "Kudo" the helpful posts!
Regular Contributor
Posts: 52
Registered: ‎10-31-2010
My Device: Not Specified
My Carrier: developer

Re: Persistent object

Thanks Lee,

 

And do u have any idea how to implement relationship between two classes ?

 

I mean relationships between two table kind of stuff ?

 

Thanks in advance Smiley Happy

Highlighted
Contributor
Posts: 47
Registered: ‎02-20-2009
My Device: Torch
My Carrier: AT&T

Re: Persistent object

The persistent store stores objects, so you would need to create a class that both applications use. However, IMHO, the persistent store shouldn't really be used as a database. Keep in mind you are messing with a finite amount of memory space...and it's shared...

 

I guess in short, the Persistent Store is not a database, its a storage mechanism to store entire objects into NVRAM. RMS has similar limitations. Maybe if you described what youre trying to do...

---
LVM Engineering, Inc.
www.LVMEngineering.com

Don't forget to "Kudo" the helpful posts!
Regular Contributor
Posts: 52
Registered: ‎10-31-2010
My Device: Not Specified
My Carrier: developer

Re: Persistent object

Thanks for your explanation.