Edson Carlos Ericksson Richter wrote:
As far as you have explained, you should not get ClassCastException. First let's go analize your code:
1) Product implements InterfaceProduct. 2) ProductGroup have a products list. Ok, have you set the collection-class in the collection-descriptor to ManageableArrayList? If you have not, do it, because default is RemovalAwareCollection (you can't make cast from Collection to List, or you will get ClassCastException).
Without more details is hard to give you better ideais about what's can be going wrong.
Best regards,
Edson Richter
----- Original Message ----- From: Mauricio Montblanch To: OJB Users List Sent: Friday, March 19, 2004 11:54 AM
Subject: Newbie Proxy problem
Hi I am trying to use a dynamic proxy in a 1:n relation (loading a list) but a I can 't figure out how make it work (I get a java.lang.ClassCastException when I try to get the any object), can anyone give me a simple example of how to use a dynamic proxy.
Detail
Clases:
Product InterfaceProduct (Interface)
ProductGroup (contains List products)
XML: <class-descriptor class="Product" proxy="dynamic" table="PRODUCT"> .............. <class-descriptor class="ProductGroup" table="PRODUCTGROUP"> ..... ..... <collection-descriptor name="products" element-class-ref="Product"> <inverse-foreignkey field-ref="idProductGroup"/> </collection-descriptor>
so, when y get a product Group y get a list of products filled with objects of the type (InterfaceProduct)
and I can say
InterfaceProduct i=(InterfaceProduct) ptoducts.get(0);
without errors
but how I can materialize the Product Object ????????
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.624 / Virus Database: 401 - Release Date: 15/3/2004
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]