public PersistenceGuiceContext useHibernate(String... packages){
Assert.isFalse(this.useHibernate, "已经打开了Hibernate支持");
Assert.isFalse(this.useJPA, "已经打开了JPA支持,不能再使用Hibernate");
this.useHibernate = true;
HibernateGuiceModuleProvider hibernateGuiceModuleProvider = new HibernateGuiceModuleProvider();
if(packages != null)
hibernateGuiceModuleProvider.addScanPackages(packages);
this.addModuleProvider(hibernateGuiceModuleProvider,new TransactionGuiceModuleProvider(new HibernateLocalTransactionInterceptor()));
return this;
}