On Fri, Dec 21, 2012 at 4:07 PM, Lucio Crusca <lu...@sulweb.org> wrote:

> In data venerdì 21 dicembre 2012 13:41:36, Martin Grigorov ha scritto:
> > Hi,
> >
> > The page cannot be a bean, so it cannot be @Stateless.
> > Better create a stateless EJB which has a reference to @PersistenceUnit:
>
> Thanks for pointing that out.
>
> > class MyPage extends WebPage {
> >
> >   @EJB
> >   private MyBean ejb;
> >
> >   ....
> >   ejb.store(entity)
> >
> > }
> >
> > interface MyBean {
> >   void store(Entity entity)
> > }
> >
> > @Stateless
> > class MyBeanImpl implements MyBean {
> >    @PersistenceUnit
> >    private EntityManagerFactory emf;
> >
> >     @Override
> >     public void store(Entity entity) {
> >         emf.getEntityManager().persist(entity);
> >     }
> > }
>
> Ok, but what about Java-EE-Inject? Is that the standard (most widely used)
> way
> to integrate JPA (or hibernate) into wicket applications?
>
>
I think Spring is still dominant in this area.


>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com <http://jweekend.com/>

Reply via email to