[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ClassCastException
- To: ozone-users@ozone-db.org
- Subject: Re: ClassCastException
- From: Falko Braeutigam <falko@smb-tec.com>
- Date: Thu, 2 Nov 2000 22:02:55 +0100
- Delivered-To: softw7-ozone-db:org-ozone-users@ozone-db.org
- In-Reply-To: <20001031075627.6206.qmail@nicole.catcha.com>
- Organization: SMB
- References: <F198JSFsxf4yp8ARf3s0000f1d5@hotmail.com> <20001006035104.36646.qmail@catcha.com> <20001031075627.6206.qmail@nicole.catcha.com>
On Tue, 31 Oct 2000, you wrote:
> 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
>
> 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 ?
Both, getting all names and getting all objects of a class, is not supported.
IMO this would mislead programmers to use ozone in a wrong way. The type and/or
the name of an object should not be used to emulate collection features. If you
need a particular access path to the object (via a name in a map or something)
than store the object in a appropriate collection. The root names are not meant
to be used for this.
Falko
--
______________________________________________________________________
Falko Braeutigam mailto:falko@smb-tec.com
SMB GmbH http://www.smb-tec.com