GWT Gilead (JPA configuration)

前端 未结 1 1602
长情又很酷
长情又很酷 2020-12-22 11:51

From the Gilead official site:

Note that you still have to properly initialize PersistentBeanManager with associated PersistenceUtil, proxy st

相关标签:
1条回答
  • 2020-12-22 12:12

    If you're using JPA with Hibernate, you can use HibernateJpaUtil like this:

    String PERSISTENCE_UNIT_NAME = "...";
    EntityManagerFactory emf = 
        Persistence.createEntityManagerFactory(PERSISTENCE_UNIT_NAME);
    
    HibernateJpaUtil hibernateJpaUtil = new HibernateJpaUtil();
    hibernateJpaUtil.setEntityManagerFactory(emf);
    
    PersistentBeanManager persistentBeanManager =
        GwtConfigurationHelper.initGwtStatelessBeanManager(hibernateJpaUtil);
    
    setBeanManager(persistentBeanManager);
    

    If you're using JPA with another implementation than Hibernate, you're probably currently out of luck - or you'd have to implement IPersistenceUtil yourself.

    http://noon.gilead.free.fr/gilead/index.php?page=overview :

    even if Hibernate is the only one currently supported, OpenJPA and EclipseLink supports is planned

    0 讨论(0)
提交回复
热议问题