Examples of JpaGuiceModuleProvider


Examples of org.jrest4guice.core.persist.jpa.JpaGuiceModuleProvider

  @SuppressWarnings("unchecked")
  @BeforeClass
  public static void setUpBeforeClass() throws Exception {
    GuiceContext context = GuiceContext.getInstance();
    context.addModuleProvider(
            new JpaGuiceModuleProvider(),
            (new DaoModuleProvider("org.jrest4guice.dao.test.jpa", "org.jrest4guice.dao.jpa"))
                    .addActionContextProviders(new JpaContextProvider())).init();
    bookDao = context.getBean(BookDao.class);
   
    Book b0 = getNewBook("Book 0", 10f, 10);
View Full Code Here

Examples of org.jrest4guice.core.persist.jpa.JpaGuiceModuleProvider

  public static void setup() {
    GuiceContext context = GuiceContext.getInstance();
    context.addModuleProvider(
            (new DaoModuleProvider("org.jrest4guice.dao.test.jpa", "org.jrest4guice.dao.jpa"))
                    .addActionContextProviders(new JpaContextProvider()),
            new JpaGuiceModuleProvider()).init();
    dao = context.getBean(BookDao.class);
   
    Book b0 = getNewBook("Book 0", 10f, 10);
    Book b1 = getNewBook("Book 1", 10f, 20);
    Book b2 = getNewBook("Book 2", 10f, 30);
View Full Code Here

Examples of org.jrest4guice.core.persist.jpa.JpaGuiceModuleProvider

    // context.init();
    // BookDao dao = context.getBean(BookDao.class);
   
    GuiceContext context = GuiceContext.getInstance();
    context.addModuleProvider(new DaoModuleProvider("org.jrest4guice.dao.test.jpa", "org.jrest4guice.dao.jpa"),
            new JpaGuiceModuleProvider()).init();
    BookDao dao = context.getBean(BookDao.class);
    Assert.assertNotNull(dao);
   
    Book b1 = getNewBook("Book 1", 10f, 10);
    Book b2 = getNewBook("Book 2", 10f, 10);
View Full Code Here

Examples of org.jrest4guice.persistence.jpa.JpaGuiceModuleProvider

  public PersistenceGuiceContext useJPA(String... packages){
    Assert.isFalse(this.useJPA, "已经打开了JPA支持");
    Assert.isFalse(this.useHibernate, "已经打开了Hibernate支持,不能再使用JPA");
    this.useJPA = true;
   
    JpaGuiceModuleProvider jpaGuiceModuleProvider = new JpaGuiceModuleProvider();
    if(packages != null)
      jpaGuiceModuleProvider.addScanPackages(packages);
   
    this.addModuleProvider(jpaGuiceModuleProvider,new TransactionGuiceModuleProvider(new JpaLocalTransactionInterceptor()));
    return this;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.