I have the following model:
A class A has a reference to a class B. B has several subclasses including C. 
Relation between A and B is Lazy.

When I get an A instance from the DB, I invoke the getB() method if A class and 
then I cast the B instance into C in order to invoke a method that only exists 
on C instance.

For B and C I use a Single inheritance.


  |   lazy
  | A---->B
  |      Î
  |      C(extends B)
  |      getX()
  | 


When I cast the getB() instance I have a ClassCastException because getB() is a 
javassist proxy instance on B and not on C. 

My workaround is to switch A/B relationship to EAGER but I really like to keep 
it lazy.

Is there some workaround for this proxy issue ? (that's the same issue with 
CGLIB). Is it a know bug ?


View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4084463#4084463

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4084463

_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to