Hi,

we have an entity which has a many-to-one property that references a 
polymorphic entity.


  |     @ManyToOne(cascade = {CascadeType.MERGE}, fetch = FetchType.EAGER)  // 
EAGER
  |     @JoinColumn(name = "wle_mbtid", unique = false, nullable = true, 
insertable = true, updatable = true)
  |     public Musterbestandteil getMusterbestandteil() {
  |         return this.musterbestandteil;
  |     }
  | 
  | 

The Musterbestandteil class is the base class for several sub-classes. When I 
load the property eagerly everything works as expected, but when it is lazily 
loaded "instanceof" does not work because the property is some CGLIBxxx class.

Is there a way around this or do I have to load polymorphic relations eagerly. 
That would lead into trouble with entities that have more than one polymorphic 
x-to-many relations.

Thanks
Stefan

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

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


_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to