Java Code Examples for org.springframework.boot.autoconfigure.orm.jpa.JpaProperties

The following examples show how to use org.springframework.boot.autoconfigure.orm.jpa.JpaProperties. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
/**
 * {@link JpaDistributionSetManagement} bean.
 *
 * @return a new {@link DistributionSetManagement}
 */
@Bean
@ConditionalOnMissingBean
DistributionSetManagement distributionSetManagement(final EntityManager entityManager,
        final DistributionSetRepository distributionSetRepository,
        final DistributionSetTagManagement distributionSetTagManagement, final SystemManagement systemManagement,
        final DistributionSetTypeManagement distributionSetTypeManagement, final QuotaManagement quotaManagement,
        final DistributionSetMetadataRepository distributionSetMetadataRepository,
        final TargetFilterQueryRepository targetFilterQueryRepository, final ActionRepository actionRepository,
        final NoCountPagingRepository criteriaNoCountDao, final EventPublisherHolder eventPublisherHolder,
        final TenantAware tenantAware, final VirtualPropertyReplacer virtualPropertyReplacer,
        final SoftwareModuleRepository softwareModuleRepository,
        final DistributionSetTagRepository distributionSetTagRepository,
        final AfterTransactionCommitExecutor afterCommit, final JpaProperties properties) {
    return new JpaDistributionSetManagement(entityManager, distributionSetRepository, distributionSetTagManagement,
            systemManagement, distributionSetTypeManagement, quotaManagement, distributionSetMetadataRepository,
            targetFilterQueryRepository, actionRepository, criteriaNoCountDao, eventPublisherHolder, tenantAware,
            virtualPropertyReplacer, softwareModuleRepository, distributionSetTagRepository, afterCommit,
            properties.getDatabase());

}
 
Example 2
/**
 * {@link JpaTenantConfigurationManagement} bean.
 *
 * @return a new {@link TenantConfigurationManagement}
 */
@Bean
@ConditionalOnMissingBean
TargetManagement targetManagement(final EntityManager entityManager, final QuotaManagement quotaManagement,
        final TargetRepository targetRepository, final TargetMetadataRepository targetMetadataRepository,
        final RolloutGroupRepository rolloutGroupRepository,
        final DistributionSetRepository distributionSetRepository,
        final TargetFilterQueryRepository targetFilterQueryRepository,
        final TargetTagRepository targetTagRepository, final NoCountPagingRepository criteriaNoCountDao,
        final EventPublisherHolder eventPublisherHolder, final TenantAware tenantAware,
        final AfterTransactionCommitExecutor afterCommit, final VirtualPropertyReplacer virtualPropertyReplacer,
        final JpaProperties properties) {
    return new JpaTargetManagement(entityManager, quotaManagement, targetRepository, targetMetadataRepository,
            rolloutGroupRepository, distributionSetRepository, targetFilterQueryRepository, targetTagRepository,
            criteriaNoCountDao, eventPublisherHolder, tenantAware, afterCommit, virtualPropertyReplacer,
            properties.getDatabase());
}
 
Example 3
/**
 * {@link JpaDeploymentManagement} bean.
 *
 * @return a new {@link DeploymentManagement}
 */
@Bean
@ConditionalOnMissingBean
DeploymentManagement deploymentManagement(final EntityManager entityManager,
        final ActionRepository actionRepository, final DistributionSetRepository distributionSetRepository,
        final TargetRepository targetRepository, final ActionStatusRepository actionStatusRepository,
        final AuditorAware<String> auditorProvider, final EventPublisherHolder eventPublisherHolder,
        final AfterTransactionCommitExecutor afterCommit, final VirtualPropertyReplacer virtualPropertyReplacer,
        final PlatformTransactionManager txManager,
        final TenantConfigurationManagement tenantConfigurationManagement, final QuotaManagement quotaManagement,
        final SystemSecurityContext systemSecurityContext, final TenantAware tenantAware,
        final JpaProperties properties, final RepositoryProperties repositoryProperties) {
    return new JpaDeploymentManagement(entityManager, actionRepository, distributionSetRepository, targetRepository,
            actionStatusRepository, auditorProvider, eventPublisherHolder, afterCommit, virtualPropertyReplacer,
            txManager, tenantConfigurationManagement, quotaManagement, systemSecurityContext, tenantAware,
            properties.getDatabase(), repositoryProperties);
}
 
Example 4
Source Project: spring-boot-multi-tenancy   Source File: Application.java    License: MIT License 5 votes vote down vote up
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory(EntityManagerFactoryBuilder factory, DataSource dataSource, JpaProperties properties) {
  HibernateSettings settings = new HibernateSettings();
  settings.ddlAuto("create-drop");
  Map<String, Object> jpaProperties = new HashMap<>(properties.getHibernateProperties(settings));
  jpaProperties.put("hibernate.ejb.interceptor", hibernateInterceptor());
  return factory.dataSource(dataSource).packages("com.example").properties(jpaProperties).build();
}
 
Example 5
Source Project: griffin   Source File: EclipseLinkJpaConfigForTest.java    License: Apache License 2.0 5 votes vote down vote up
protected EclipseLinkJpaConfigForTest(
        DataSource ds,
        JpaProperties properties,
        ObjectProvider<JtaTransactionManager> jtm,
        ObjectProvider<TransactionManagerCustomizers> tmc) {
    super(ds, properties, jtm, tmc);
}
 
Example 6
Source Project: spring-boot-demo   Source File: SecondJpaConfig.java    License: MIT License 5 votes vote down vote up
/**
 * 获取主库实体管理工厂对象
 *
 * @param secondDataSource 注入名为secondDataSource的数据源
 * @param jpaProperties    注入名为secondJpaProperties的jpa配置信息
 * @param builder          注入EntityManagerFactoryBuilder
 * @return 实体管理工厂对象
 */
@Bean(name = "secondEntityManagerFactory")
public LocalContainerEntityManagerFactoryBean entityManagerFactory(@Qualifier("secondDataSource") DataSource secondDataSource, @Qualifier("secondJpaProperties") JpaProperties jpaProperties, EntityManagerFactoryBuilder builder) {
    return builder
            // 设置数据源
            .dataSource(secondDataSource)
            // 设置jpa配置
            .properties(jpaProperties.getProperties())
            // 设置实体包名
            .packages(ENTITY_PACKAGE)
            // 设置持久化单元名,用于@PersistenceContext注解获取EntityManager时指定数据源
            .persistenceUnit("secondPersistenceUnit").build();
}
 
Example 7
Source Project: spring-boot-demo   Source File: PrimaryJpaConfig.java    License: MIT License 5 votes vote down vote up
/**
 * 扫描spring.jpa.primary开头的配置信息
 *
 * @return jpa配置信息
 */
@Primary
@Bean(name = "primaryJpaProperties")
@ConfigurationProperties(prefix = "spring.jpa.primary")
public JpaProperties jpaProperties() {
    return new JpaProperties();
}
 
Example 8
Source Project: spring-boot-demo   Source File: PrimaryJpaConfig.java    License: MIT License 5 votes vote down vote up
/**
 * 获取主库实体管理工厂对象
 *
 * @param primaryDataSource 注入名为primaryDataSource的数据源
 * @param jpaProperties     注入名为primaryJpaProperties的jpa配置信息
 * @param builder           注入EntityManagerFactoryBuilder
 * @return 实体管理工厂对象
 */
@Primary
@Bean(name = "primaryEntityManagerFactory")
public LocalContainerEntityManagerFactoryBean entityManagerFactory(@Qualifier("primaryDataSource") DataSource primaryDataSource, @Qualifier("primaryJpaProperties") JpaProperties jpaProperties, EntityManagerFactoryBuilder builder) {
    return builder
            // 设置数据源
            .dataSource(primaryDataSource)
            // 设置jpa配置
            .properties(jpaProperties.getProperties())
            // 设置实体包名
            .packages(ENTITY_PACKAGE)
            // 设置持久化单元名,用于@PersistenceContext注解获取EntityManager时指定数据源
            .persistenceUnit("primaryPersistenceUnit").build();
}
 
Example 9
/**
 * {@link JpaDistributionSetManagement} bean.
 *
 * @return a new {@link DistributionSetManagement}
 */
@Bean
@ConditionalOnMissingBean
DistributionSetTypeManagement distributionSetTypeManagement(
        final DistributionSetTypeRepository distributionSetTypeRepository,
        final SoftwareModuleTypeRepository softwareModuleTypeRepository,
        final DistributionSetRepository distributionSetRepository,
        final VirtualPropertyReplacer virtualPropertyReplacer, final NoCountPagingRepository criteriaNoCountDao,
        final JpaProperties properties, final QuotaManagement quotaManagement) {
    return new JpaDistributionSetTypeManagement(distributionSetTypeRepository, softwareModuleTypeRepository,
            distributionSetRepository, virtualPropertyReplacer, criteriaNoCountDao, properties.getDatabase(),
            quotaManagement);
}
 
Example 10
/**
 * {@link JpaTargetTagManagement} bean.
 *
 * @return a new {@link TargetTagManagement}
 */
@Bean
@ConditionalOnMissingBean
TargetTagManagement targetTagManagement(final TargetTagRepository targetTagRepository,
        final TargetRepository targetRepository, final VirtualPropertyReplacer virtualPropertyReplacer,
        final JpaProperties properties) {
    return new JpaTargetTagManagement(targetTagRepository, targetRepository, virtualPropertyReplacer,
            properties.getDatabase());
}
 
Example 11
/**
 * {@link JpaDistributionSetTagManagement} bean.
 *
 * @return a new {@link JpaDistributionSetTagManagement}
 */
@Bean
@ConditionalOnMissingBean
DistributionSetTagManagement distributionSetTagManagement(
        final DistributionSetTagRepository distributionSetTagRepository,
        final DistributionSetRepository distributionSetRepository,
        final VirtualPropertyReplacer virtualPropertyReplacer, final NoCountPagingRepository criteriaNoCountDao,
        final JpaProperties properties) {
    return new JpaDistributionSetTagManagement(distributionSetTagRepository, distributionSetRepository,
            virtualPropertyReplacer, criteriaNoCountDao, properties.getDatabase());
}
 
Example 12
/**
 * {@link JpaSoftwareModuleManagement} bean.
 *
 * @return a new {@link SoftwareModuleManagement}
 */
@Bean
@ConditionalOnMissingBean
SoftwareModuleManagement softwareModuleManagement(final EntityManager entityManager,
        final DistributionSetRepository distributionSetRepository,
        final SoftwareModuleRepository softwareModuleRepository,
        final SoftwareModuleMetadataRepository softwareModuleMetadataRepository,
        final SoftwareModuleTypeRepository softwareModuleTypeRepository,
        final NoCountPagingRepository criteriaNoCountDao, final AuditorAware<String> auditorProvider,
        final ArtifactManagement artifactManagement, final QuotaManagement quotaManagement,
        final VirtualPropertyReplacer virtualPropertyReplacer, final JpaProperties properties) {
    return new JpaSoftwareModuleManagement(entityManager, distributionSetRepository, softwareModuleRepository,
            softwareModuleMetadataRepository, softwareModuleTypeRepository, criteriaNoCountDao, auditorProvider,
            artifactManagement, quotaManagement, virtualPropertyReplacer, properties.getDatabase());
}
 
Example 13
/**
 * {@link JpaSoftwareModuleTypeManagement} bean.
 *
 * @return a new {@link SoftwareModuleTypeManagement}
 */
@Bean
@ConditionalOnMissingBean
SoftwareModuleTypeManagement softwareModuleTypeManagement(
        final DistributionSetTypeRepository distributionSetTypeRepository,
        final SoftwareModuleTypeRepository softwareModuleTypeRepository,
        final VirtualPropertyReplacer virtualPropertyReplacer,
        final SoftwareModuleRepository softwareModuleRepository, final NoCountPagingRepository criteriaNoCountDao,
        final JpaProperties properties) {
    return new JpaSoftwareModuleTypeManagement(distributionSetTypeRepository, softwareModuleTypeRepository,
            virtualPropertyReplacer, softwareModuleRepository, criteriaNoCountDao, properties.getDatabase());
}
 
Example 14
@Bean
@ConditionalOnMissingBean
RolloutManagement rolloutManagement(final TargetManagement targetManagement,
        final DeploymentManagement deploymentManagement, final RolloutGroupManagement rolloutGroupManagement,
        final DistributionSetManagement distributionSetManagement, final ApplicationContext context,
        final EventPublisherHolder eventPublisherHolder, final VirtualPropertyReplacer virtualPropertyReplacer,
        final PlatformTransactionManager txManager, final TenantAware tenantAware, final LockRegistry lockRegistry,
        final JpaProperties properties, final RolloutApprovalStrategy rolloutApprovalStrategy,
        final TenantConfigurationManagement tenantConfigurationManagement,
        final SystemSecurityContext systemSecurityContext) {
    return new JpaRolloutManagement(targetManagement, deploymentManagement, rolloutGroupManagement,
            distributionSetManagement, context, eventPublisherHolder, virtualPropertyReplacer, txManager,
            tenantAware, lockRegistry, properties.getDatabase(), rolloutApprovalStrategy,
            tenantConfigurationManagement, systemSecurityContext);
}
 
Example 15
/**
 * {@link JpaRolloutGroupManagement} bean.
 *
 * @return a new {@link RolloutGroupManagement}
 */
@Bean
@ConditionalOnMissingBean
RolloutGroupManagement rolloutGroupManagement(final RolloutGroupRepository rolloutGroupRepository,
        final RolloutRepository rolloutRepository, final ActionRepository actionRepository,
        final TargetRepository targetRepository, final EntityManager entityManager,
        final VirtualPropertyReplacer virtualPropertyReplacer, final RolloutStatusCache rolloutStatusCache,
        final JpaProperties properties) {
    return new JpaRolloutGroupManagement(rolloutGroupRepository, rolloutRepository, actionRepository,
            targetRepository, entityManager, virtualPropertyReplacer, rolloutStatusCache, properties.getDatabase());
}
 
Example 16
Source Project: txle   Source File: EclipseLinkJpaConfiguration.java    License: Apache License 2.0 4 votes vote down vote up
EclipseLinkJpaConfiguration(DataSource dataSource,
    JpaProperties properties,
    ObjectProvider<JtaTransactionManager> jtaTransactionManagerProvider,
    ObjectProvider<TransactionManagerCustomizers> transactionManagerCustomizers) {
  super(dataSource, properties, jtaTransactionManagerProvider, transactionManagerCustomizers);
}
 
Example 17
Source Project: cloud-espm-cloud-native   Source File: EspmJpaConfig.java    License: Apache License 2.0 4 votes vote down vote up
protected EspmJpaConfig(DataSource dataSource, JpaProperties properties,
		ObjectProvider<JtaTransactionManager> jtaTransactionManager) {
	super(dataSource, properties, jtaTransactionManager);
}
 
Example 18
EclipseLinkJpaConfiguration(DataSource dataSource,
    JpaProperties properties,
    ObjectProvider<JtaTransactionManager> jtaTransactionManagerProvider,
    ObjectProvider<TransactionManagerCustomizers> transactionManagerCustomizers) {
  super(dataSource, properties, jtaTransactionManagerProvider, transactionManagerCustomizers);
}
 
Example 19
Source Project: griffin   Source File: EclipseLinkJpaConfig.java    License: Apache License 2.0 4 votes vote down vote up
protected EclipseLinkJpaConfig(
    DataSource ds, JpaProperties properties,
    ObjectProvider<JtaTransactionManager> jtm,
    ObjectProvider<TransactionManagerCustomizers> tmc) {
    super(ds, properties, jtm, tmc);
}
 
Example 20
EclipseLinkJpaConfiguration(DataSource dataSource,
    JpaProperties properties,
    ObjectProvider<JtaTransactionManager> jtaTransactionManagerProvider,
    ObjectProvider<TransactionManagerCustomizers> transactionManagerCustomizers) {
  super(dataSource, properties, jtaTransactionManagerProvider, transactionManagerCustomizers);
}
 
Example 21
Source Project: cloud-s4-sdk-examples   Source File: Application.java    License: Apache License 2.0 4 votes vote down vote up
protected Application(DataSource dataSource, JpaProperties properties,
                      ObjectProvider<JtaTransactionManager> jtaTransactionManagerProvider,
                      ObjectProvider<TransactionManagerCustomizers> transactionManagerCustomizers) {
    super(dataSource, properties, jtaTransactionManagerProvider, transactionManagerCustomizers);
}
 
Example 22
Source Project: spring-boot-demo   Source File: SecondJpaConfig.java    License: MIT License 4 votes vote down vote up
/**
 * 扫描spring.jpa.second开头的配置信息
 *
 * @return jpa配置信息
 */
@Bean(name = "secondJpaProperties")
@ConfigurationProperties(prefix = "spring.jpa.second")
public JpaProperties jpaProperties() {
    return new JpaProperties();
}
 
Example 23
protected RepositoryApplicationConfiguration(final DataSource dataSource, final JpaProperties properties,
        final ObjectProvider<JtaTransactionManager> jtaTransactionManagerProvider,
        final ObjectProvider<TransactionManagerCustomizers> transactionManagerCustomizers) {
    super(dataSource, properties, jtaTransactionManagerProvider, transactionManagerCustomizers);
}
 
Example 24
Source Project: metron   Source File: JpaConfiguration.java    License: Apache License 2.0 4 votes vote down vote up
protected JpaConfiguration(DataSource dataSource, JpaProperties properties, ObjectProvider<JtaTransactionManager> jtaTransactionManager, ObjectProvider<TransactionManagerCustomizers> transactionManagerCustomizers) {
  super(dataSource, properties, jtaTransactionManager, transactionManagerCustomizers);
}
 
Example 25
Source Project: tutorials   Source File: JpaConfiguration.java    License: MIT License 4 votes vote down vote up
protected JpaConfiguration(DataSource dataSource, JpaProperties properties, ObjectProvider<JtaTransactionManager> jtaTransactionManager, ObjectProvider<TransactionManagerCustomizers> transactionManagerCustomizers) {
    super(dataSource, properties, jtaTransactionManager, transactionManagerCustomizers);
}
 
Example 26
/**
 * {@link JpaTargetFilterQueryManagement} bean.
 *
 * @param targetFilterQueryRepository
 *            holding {@link TargetFilterQuery} entities
 * @param targetRepository
 *            holding {@link Target} entities
 * @param virtualPropertyReplacer
 *            for RSQL handling
 * @param distributionSetManagement
 *            for auto assign DS access
 * @param quotaManagement
 *            to access quotas
 * @param properties
 *            JPA properties
 *
 * @return a new {@link TargetFilterQueryManagement}
 */
@Bean
@ConditionalOnMissingBean
TargetFilterQueryManagement targetFilterQueryManagement(
        final TargetFilterQueryRepository targetFilterQueryRepository, final TargetRepository targetRepository,
        final VirtualPropertyReplacer virtualPropertyReplacer,
        final DistributionSetManagement distributionSetManagement, final QuotaManagement quotaManagement,
        final JpaProperties properties, final TenantConfigurationManagement tenantConfigurationManagement,
        final SystemSecurityContext systemSecurityContext) {
    return new JpaTargetFilterQueryManagement(targetFilterQueryRepository, targetRepository,
            virtualPropertyReplacer, distributionSetManagement, quotaManagement, properties.getDatabase(),
            tenantConfigurationManagement, systemSecurityContext);
}