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;
}
To work with lazy loaded polymorphic entity you need to implement ProxyVisitorPattern http://community.jboss.org/wiki/ProxyVisitorPattern