2 Replies Latest reply on Jun 15, 2009 9:52 AM by Wolfgang Knauf

    how to get principal from Entity

    apdo Newbie

      I know the more accepted pattern is to not have logic into the entity. However I am performing the migration of an application from EJB2 to EJB3 where there is logic into the entities.

      In my old entity bean (not session bean), I have code that call getCallerPrincipal from the EntityContext. I have tried, using @Resource, to inject EntityContext but I got a null value. Is there a way to access the callerPrincipal from entity in EJB3.

      Thank you very much for your help,

      An Phong Do