本文整理汇总了Java中com.google.inject.persist.jpa.JpaPersistModule类的典型用法代码示例。如果您正苦于以下问题:Java JpaPersistModule类的具体用法?Java JpaPersistModule怎么用?Java JpaPersistModule使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
JpaPersistModule类属于com.google.inject.persist.jpa包,在下文中一共展示了JpaPersistModule类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: bindJPAPersistModule
import com.google.inject.persist.jpa.JpaPersistModule; //导入依赖的package包/类
protected void bindJPAPersistModule() {
JpaPersistModule jpa = new JpaPersistModule("K2IDB");
Config dbConfig = config.getConfig("db");
Properties properties = new Properties();
properties.put("javax.persistence.jdbc.driver", dbConfig.getString("driver"));
properties.put("javax.persistence.jdbc.url", dbConfig.getString("url"));
properties.put("javax.persistence.jdbc.user", dbConfig.getString("user"));
properties.put("javax.persistence.jdbc.password", dbConfig.getString("password"));
dbConfig.getObject("additional").entrySet()
.forEach(e -> properties.put(e.getKey(), (String) e.getValue().unwrapped()));
jpa.properties(properties);
install(jpa);
}
示例2: getInjector
import com.google.inject.persist.jpa.JpaPersistModule; //导入依赖的package包/类
@Override
protected Injector getInjector() {
final Properties persistenceUnitProperties = new Properties();
persistenceUnitProperties.put(AvailableSettings.JPA_JDBC_URL,
Utils.getDatabaseUrl(endPointHealthConfiguration.databaseFile()));
persistenceUnitProperties.put(AvailableSettings.JPA_JDBC_USER,
endPointHealthConfiguration.databaseUser());
persistenceUnitProperties.put(AvailableSettings.JPA_JDBC_PASSWORD,
endPointHealthConfiguration.databasePassword());
return Guice.createInjector(
new JpaPersistModule(PERSISTENCE_UNIT).properties(persistenceUnitProperties),
new EndPointHealthServletModule());
}
示例3: configure
import com.google.inject.persist.jpa.JpaPersistModule; //导入依赖的package包/类
@Override
protected void configure() {
install(new JpaPersistModule("main"));
H2DBTestServer server = H2DBTestServer.startDefault();
bind(SchemaInitializer.class)
.toInstance(new FlywaySchemaInitializer(server.getDataSource(), "che-schema"));
bind(DBInitializer.class).asEagerSingleton();
bind(TckResourcesCleaner.class).toInstance(new H2JpaCleaner(server));
bind(new TypeLiteral<TckRepository<FreeResourcesLimitImpl>>() {})
.toInstance(new JpaTckRepository<>(FreeResourcesLimitImpl.class));
bind(new TypeLiteral<TckRepository<AccountImpl>>() {})
.toInstance(new JpaTckRepository<>(AccountImpl.class));
bind(FreeResourcesLimitDao.class).to(JpaFreeResourcesLimitDao.class);
}
示例4: configure
import com.google.inject.persist.jpa.JpaPersistModule; //导入依赖的package包/类
@Override
protected void configure() {
install(new JpaPersistModule("main"));
H2DBTestServer server = H2DBTestServer.startDefault();
bind(SchemaInitializer.class)
.toInstance(new FlywaySchemaInitializer(server.getDataSource(), "che-schema"));
bind(DBInitializer.class).asEagerSingleton();
bind(TckResourcesCleaner.class).toInstance(new H2JpaCleaner(server));
bind(new TypeLiteral<AbstractPermissionsDomain<MemberImpl>>() {}).to(OrganizationDomain.class);
bind(new TypeLiteral<TckRepository<OrganizationImpl>>() {})
.to(JpaOrganizationImplTckRepository.class);
bind(new TypeLiteral<TckRepository<UserImpl>>() {})
.toInstance(new JpaTckRepository<>(UserImpl.class));
bind(new TypeLiteral<TckRepository<MemberImpl>>() {})
.toInstance(new JpaTckRepository<>(MemberImpl.class));
bind(new TypeLiteral<TckRepository<OrganizationDistributedResourcesImpl>>() {})
.toInstance(new JpaTckRepository<>(OrganizationDistributedResourcesImpl.class));
bind(OrganizationDao.class).to(JpaOrganizationDao.class);
bind(MemberDao.class).to(JpaMemberDao.class);
bind(OrganizationDistributedResourcesDao.class)
.to(JpaOrganizationDistributedResourcesDao.class);
}
示例5: configure
import com.google.inject.persist.jpa.JpaPersistModule; //导入依赖的package包/类
@Override
protected void configure() {
install(new JpaPersistModule("services-jpa-unit"));
bind(UserDao.class).to(JpaUserDao.class);
bind(org.eurekaclinical.standardapis.dao.UserDao.class).to(JpaUserDao.class);
bind(RoleDao.class).to(JpaRoleDao.class);
bind(TimeUnitDao.class).to(JpaTimeUnitDao.class);
bind(ValueComparatorDao.class).to(JpaValueComparatorDao.class);
bind(FrequencyTypeDao.class).to(JpaFrequencyTypeDao.class);
bind(RelationOperatorDao.class).to(JpaRelationOperatorDao.class);
bind(PhenotypeEntityDao.class).to(JpaPhenotypeEntityDao.class);
bind(ThresholdsOperatorDao.class).to(JpaThresholdsOperatorDao.class);
bind(new TypeLiteral<PropositionFinder<String>>(){}).to(TestPropositionFinder.class);
}
示例6: configure
import com.google.inject.persist.jpa.JpaPersistModule; //导入依赖的package包/类
@Override
protected void configure() {
install(new JpaPersistModule("backend-jpa-unit"));
bind(JobDao.class).to(JpaJobDao.class);
bind(JobEventDao.class).to(JpaJobEventDao.class);
bind(AuthorizedUserDao.class).to(JpaEtlUserDao.class);
bind(RoleDao.class).to(JpaRoleDao.class);
bind(EtlGroupDao.class).to(JpaEtlGroupDao.class);
bind(DestinationDao.class).to(JpaDestinationDao.class);
bind(DeidPerPatientParamsDao.class).to(JpaDeidPerPatientParamsDao.class);
bind(SourceConfigDao.class).to(JpaSourceConfigDao.class);
bind(EurekaDeidConfigFactory.class).to(JpaEurekaDeidConfigFactory.class);
bind(EurekaDeidConfigDao.class).to(JpaEurekaDeidConfigDao.class);
bind(LinkDao.class).to(JpaLinkDao.class);
bind(EncryptionAlgorithmDao.class).to(JpaEncryptionAlgorithmDao.class);
}
示例7: getInjector
import com.google.inject.persist.jpa.JpaPersistModule; //导入依赖的package包/类
@Override
protected Injector getInjector() {
injector = Guice.createInjector(new ServletModule() {
@Override
protected void configureServlets() {
String persistenceUnitName = PersistenceInitializeListener.getPersistenceUnitName();
install(new JpaPersistModule(persistenceUnitName));
filter("/*").through(PersistFilter.class);
requestStaticInjection(EntityOperatorProvider.class);
bind(GitOperation.class).in(Singleton.class);
bind(GitApi.class).in(Singleton.class);
ClassFinder.findClasses("gw.service").forEach(clazz -> bind(clazz).in(Singleton.class));
}
});
return injector;
}
示例8: getInjector
import com.google.inject.persist.jpa.JpaPersistModule; //导入依赖的package包/类
@Override
protected Injector getInjector() {
return Guice.createInjector(new ServletModule() {
protected void configureServlets() {
install(new JpaPersistModule("IneFormShowCaseWithEjbs"));
filter("/*").through(PersistFilter.class);
};
}
, new IneFrameBaseServletModule("ineformshowcasewithejbs", ShowcaseDispatchServlet.class)
// , new IneCoreBaseServletModule("ineformshowcasewithejbs", ShowcaseDispatchServlet.class)
, new UploadServletModule()
, new TestServletModule()
, new IneFrameBaseActionHanlderModule()
, new IneFrameBaseModule()
, new IneFormActionHanlderModule()
, new IneFormDispatcherGuiceModule()
// , new IneFrameModuleGuiceModule()
, new IneModuleGuiceModule(false)
);
}
示例9: installDependencies
import com.google.inject.persist.jpa.JpaPersistModule; //导入依赖的package包/类
private void installDependencies() {
install(new JpaPersistModule("ambari-javadb"));
install(new FactoryModuleBuilder().implement(
Cluster.class, ClusterImpl.class).build(ClusterFactory.class));
install(new FactoryModuleBuilder().implement(
Host.class, HostImpl.class).build(HostFactory.class));
install(new FactoryModuleBuilder().implement(
Service.class, ServiceImpl.class).build(ServiceFactory.class));
install(new FactoryModuleBuilder().implement(
ServiceComponent.class, ServiceComponentImpl.class).build(
ServiceComponentFactory.class));
install(new FactoryModuleBuilder().implement(
ServiceComponentHost.class, ServiceComponentHostImpl.class).build(
ServiceComponentHostFactory.class));
install(new FactoryModuleBuilder().implement(
Config.class, ConfigImpl.class).build(ConfigFactory.class));
install(new FactoryModuleBuilder().build(StageFactory.class));
install(new FactoryModuleBuilder().build(HostRoleCommandFactory.class));
}
示例10: configureServlets
import com.google.inject.persist.jpa.JpaPersistModule; //导入依赖的package包/类
@Override
protected void configureServlets() {
install(new JpaPersistModule("transactions-optional"));
filterRegex("^/(?!_ah/(upload|admin)).*$").through(PersistFilter.class);
MethodInterceptor finderInterceptor = new JpaFinderProxy();
requestInjection(finderInterceptor);
bindInterceptor(Matchers.any(), Matchers.annotatedWith(Finder.class), finderInterceptor);
filter(ProxyFilter.PROXY_PATH + "*").through(ProxyFilter.class);
if (SystemProperty.environment.value() == SystemProperty.Environment.Value.Development) {
filter("/_ah/api/" + "*").through(LocalDevServerFilter.class);
}
Set<Class<?>> serviceClasses = new HashSet<Class<?>>();
serviceClasses.add(DeviceEndpoint.class);
serviceClasses.add(AccountEndpoint.class);
serviceClasses.add(PresenceEndpoint.class);
serviceClasses.add(AppEngineChannelService.class);
serviceClasses.add(GoogleCloudMessaging.class);
serviceClasses.add(ApplePushNotification.class);
this.serveGuiceSystemServiceServlet("/_ah/spi/*", serviceClasses);
}
示例11: initialize
import com.google.inject.persist.jpa.JpaPersistModule; //导入依赖的package包/类
@Override
public void initialize(Bootstrap<OregamiConfiguration> bootstrap) {
OregamiConfiguration configuration = StartHelper.createConfiguration(StartHelper.getConfigFilename());
Properties jpaProperties = StartHelper.createPropertiesFromConfiguration(configuration);
JpaPersistModule jpaPersistModule = new JpaPersistModule(configuration.getDatabaseConfiguration().getJpaUnit());
jpaPersistModule.properties(jpaProperties);
guiceBundle = GuiceBundle.<OregamiConfiguration>newBuilder()
.addModule(new OregamiGuiceModule())
.addModule(jpaPersistModule)
.enableAutoConfig("org.oregami")
.setConfigClass(OregamiConfiguration.class)
.build();
bootstrap.addBundle(guiceBundle);
SimpleModule module = new SimpleModule();
//module.addSerializer(LocalDateTime.class, new CustomLocalDateTimeSerializer());
//module.addSerializer(LocalDate.class, new CustomLocalDateSerializer());
bootstrap.getObjectMapper().registerModule(module);
}
示例12: setUp
import com.google.inject.persist.jpa.JpaPersistModule; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
Injector injector = Guice.createInjector(new JpaPersistModule("CapabilitiesDirectory"), new AbstractModule() {
@Override
protected void configure() {
bind(DiscoveryEntryStore.class).to(DiscoveryEntryStorePersisted.class);
bind(DiscoveryEntry.class).to(GlobalDiscoveryEntryPersisted.class);
bind(CapabilitiesProvisioning.class).to(DefaultCapabilitiesProvisioning.class);
}
});
service = injector.getInstance(PersistService.class);
store = injector.getInstance(DiscoveryEntryStore.class);
entityManager = injector.getInstance(EntityManager.class);
}
示例13: configure
import com.google.inject.persist.jpa.JpaPersistModule; //导入依赖的package包/类
@Override
protected void configure() {
install(new JpaPersistModule("Discovery"));
AbstractModule discoveryDirectoryModule = new AbstractModule() {
@Override
protected void configure() {
}
@Provides
@Named(AbstractJoynrApplication.PROPERTY_JOYNR_DOMAIN_LOCAL)
String provideCapabilitiesDirectoryDomain(@Named(MessagingPropertyKeys.CAPABILITIES_DIRECTORY_DISCOVERY_ENTRY) GlobalDiscoveryEntry capabilitiesDirectoryEntry) {
return capabilitiesDirectoryEntry.getDomain();
}
@Provides
@Named(MessagingPropertyKeys.CHANNELID)
String provideCapabilitiesDirectoryChannelId(@Named(ConfigurableMessagingSettings.PROPERTY_CAPABILITIES_DIRECTORY_CHANNEL_ID) String discoveryDirectoriesChannelId) {
return discoveryDirectoriesChannelId;
}
};
install(Modules.override(new CapabilitiesDirectoryModule()).with(discoveryDirectoryModule));
}
示例14: configure
import com.google.inject.persist.jpa.JpaPersistModule; //导入依赖的package包/类
@Override
protected void configure() {
JpaPersistModule jpa = new JpaPersistModule("manager");
jpa.properties(properties);
jpa.configure(binder());
bind(DALInitializer.class).asEagerSingleton();
bind(ICredentialRepository.class).to(CredentialRepository.class);
bind(IDatabaseSettingsRepository.class).to(DatabaseSettingsRepository.class);
bind(IMediaLibraryRepository.class).to(MediaLibraryRepository.class);
bind(IMediaRepository.class).to(MediaRepository.class);
bind(ITagRepository.class).to(TagRepository.class);
}
示例15: configure
import com.google.inject.persist.jpa.JpaPersistModule; //导入依赖的package包/类
@Override
protected void configure() {
install(Modules.override(new JpaPersistModule(persistenceUnitName)).with(new PostguiceBridgeModule()));
requestStaticInjection(EM.class);
requestStaticInjection(Transactions.class);
}