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

Re: ClassCastException



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