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?



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

Reply via email to