All,
I use a Dynamic proxy for object A and B. I request A and B.
After the request, I have to manipulate the InterfaceA if not I have a
classCastException.
But I can use the object B.
Where is my error ?
When you define an Dynamic proxy on A, you can still manipulate A, or only
InterfaceA ?
Here is my code :
Query q = QueryFactory.newQuery(A.class, crit);
broker.beginTransaction();
Collection results = broker.getCollectionByQuery(q);
Object[] tab = results.toArray();
Object tabEdited = tab[0];
InterfaceA graEdited = (InterfaceA)tabEdited;
If I put A instead of InterfaceA I have a ClassCastException.
I have exactly the same code with B and I can manipulate B not InterfaceB.
That seems I have a mistake somewhere but I don't understand where...
Any idea what it could be ?
These is driving me nuts !!!!!!!
Thanks !