-
1. Re: New EntityInstance via SessionBean
nimo22 Aug 27, 2008 2:22 PM (in response to nimo22)When I reference my SessionBean via the @Local or the @Remote-Annotation, then I do not know, if the injection of my EntityBean (which is definitly not a SessionBean) works.
Any Suggestions?
-
2. Re: New EntityInstance via SessionBean
thejavafreak Aug 27, 2008 6:37 PM (in response to nimo22)What do you mean by creating new Instance? Do you mean by instantiating it with new Entity() ?
Of course it is better that Seam provides your entity by injecting it with @In. :-) -
3. Re: New EntityInstance via SessionBean
nimo22 Aug 28, 2008 8:36 AM (in response to nimo22)Yes, I mean instantiating.
What about distributed systems and EJB. In EJB I have (one or more) Interfaces between my sessionBeans and my viewBeans. My viewBeans have access to methods of my sessionBeans via the Interface and via the @EJB-Injection. So, when I use the @In, I do not need any Interfaces ?? I do not have an Interface between my entityBean and my viewBean! However, can inject a new Instance of my entityBean in my viewBean via @In, but this is not the idea of what EJB stands for: MethodInvocation via Interfaces.
However, I can instantiate my entityBean in my sessionBean and have indirectly instantiate it by injecting my sessionBean to my viewBean via @EJB. Is this the clean way?
What do you think about that?