[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting Object while we forgot



>From: rekaakmar@catcha.com
>Reply-To: ozone-users@ozone-db.org
>To: ozone-users@ozone-db.org
>Subject: Re: Getting Object while we forgot
>Date: 6 Oct 2000 11:51:04 +0800
>
>Quoting Don Berendsen <donberendsen@hotmail.com>:
>OK Thanks I got it,
>BTW in my system,there's 50 IDs, 50 name(s) in my log
>file. As Far As I Know those values is return by startup
>() method in WizardStore, then i only have 2 class
>(ClassA,ClassB)for example:
>ClassA root objects are : code1,code2,code3,code4...
>ClassB root objects are : name1,name2,name3,name4...
>
>when i do this:
>ClassA objA=(ClassA)db.objectForName("name1");
>i got java.lang.ClassCastException: ClassBImpl_Proxy

That's due to name1 being associated with a ClassB object. Try
ClassA objA=(ClassA)db.objectForName("code1") or
ClassB objB=(ClassB)db.objectForName("name1")

>Ok, Here's my point ,how can i get all name(root names)
>or OID from client so i can get all objects of a class ?
>(by evaluating using objecForName() method)
>TIA

It's not required and generally not desirable to have a root name for each 
object.

Perhaps it might be simpler to have a root name for each class and then 
store a Map of the objects of the class at that root with name1, name2, ... 
as keys. Then the application would only need to retain the root names 
associated with the Maps. Retrieving the Map would give you all the objects 
of the class and you could get the individual objects by name.

Hope this helps,

cheers,

don

>
>
> > On my system there's a database file named
>nameTable.wizard that has the
> > names of the root objects in a readable form when
>viewed in a text editor.
> > You might take a look in there.
> >
> > cheers,
> >
> > don
> >
> >
> > >From: rekaakmar@catcha.com
> > >Reply-To: ozone-users@ozone-db.org
> > >To: ozone-users@ozone-db.org
> > >Subject: Getting Object while we forgot
> > >Date: 5 Oct 2000 02:18:07 -0000
> > >
> > >Hello,
> > >What method to get instances/object of a class from
>ozone ?, cause i've
> > >been
> > >inserting some objects of a class, but then the next
>day i want to get
> > >those
> > >object i forgot about the names of those object so
>couldnt get the object.
> > >TIA
>
>
>-----------------------------------------------------
>Get your FREE email from Catcha! http://mail.catcha.com
>

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.