We use CDI (JSR 299) in our application (JSF2 / Seam3.0 / Hibernate 3.5.6 / GlassFish 3.1.1)
While we cannot inject resources (auxiliary POJOs) into our managed beans using @Inject, we cannot do the same in our Hibernate Entity classes.
We have a base entity class (@MappedSuperclass) from which all entity objects come from. In both classes, CDI crashes.
@MappedSuperclass
public class BaseBusinessObject implements Serializable
{
@Inject
private TestClass testClass;
}
@Entity
@NamedQueries({ @NamedQuery(name = "Account.findAll", query = "SELECT b FROM Account b") })
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class Account extends BaseBusinessObject
{
@Inject
private TestClass testClass;
}
It looks like it could be a limitation with CDI. Can anyone confirm if CDI works with Hibernate objects.
Any inputs would be appreciated.
Thanks and Regards
gkari source
share