On May 8, 2009, at 5:07 PM, Scott Hernandez wrote:

> Hi all,
>
> Do entities gets all the CanDI (like servlets, EJBs and so on)? I'm
> assuming Amber does this when creating new instances.

No they don't (unless JPA 2.0 adds that capability and I haven't  
looked at JPA recently).  That part of the CanDI spec is currently  
being revised to clarify what's injectable.  Basically, CanDI's  
injectable instances are the same as JavaEE.  So if you can use  
@Resource or @EJB, you can use @MyBinding and @Current.  Since JPA  
entities don't support injection for the older @Resource, they don't  
support CanDI.

As a non-standard JPA extension, we could add that capability, but it  
would be non-standard.

> Also, if we use Hibernate will the entities created also be injected?
> I assume not, and if not, is there a plan for supporting this?

The issue is on the JPA side of things.  The current CanDI draft  
exposes methods so JPA could inject entity beans in a standard way,  
but unless there's a hook for to intercept JPA object creation,  
Resin's CanDI can't grab the objects at the right time.

-- Scott

>
>
> Thanks in advance,
> Scott
>
>
> _______________________________________________
> resin-interest mailing list
> resin-interest@caucho.com
> http://maillist.caucho.com/mailman/listinfo/resin-interest



_______________________________________________
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest

Reply via email to