domains.MasterDomain.xml Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of syncope-core-persistence-jpa Show documentation
Show all versions of syncope-core-persistence-jpa Show documentation
Apache Syncope Core Persistence JPA
<?xml version="1.0" encoding="UTF-8"?> <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:util="http://www.springframework.org/schema/util" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd"> <bean id="MasterContentXML" class="org.apache.syncope.core.spring.ResourceWithFallbackLoader"> <property name="primary" value="file:${content.directory}/domains/MasterContent.xml"/> <property name="fallback" value="classpath:domains/MasterContent.xml"/> </bean> <bean id="MasterProperties" class="org.apache.syncope.core.spring.ResourceWithFallbackLoader"> <property name="primary" value="file:${content.directory}/domains/Master.properties"/> <property name="fallback" value="classpath:domains/Master.properties"/> </bean> <bean id="MasterDatabaseSchema" class="java.lang.String"> <constructor-arg value="${Master.schema}"/> </bean> <!-- Use JNDI datasource as default but, when not available, revert to local datasource, with different properties for execution and testing. In any case, get all JDBC connections with a determined isolation level. --> <bean id="MasterDataSource" class="org.springframework.jndi.JndiObjectFactoryBean" primary="true"> <property name="jndiName" value="java:comp/env/jdbc/syncopeMasterDataSource"/> <property name="defaultObject" ref="localMasterDataSource"/> </bean> <bean id="localMasterDataSource" class="com.zaxxer.hikari.HikariDataSource" destroy-method="close"> <property name="driverClassName" value="${Master.driverClassName}"/> <property name="jdbcUrl" value="${Master.url}"/> <property name="username" value="${Master.username}"/> <property name="password" value="${Master.password}"/> <!-- connection pool configuration - transaction isolation, default READ_COMMITTED (see SYNCOPE-202) --> <property name="transactionIsolation"> <util:constant static-field="${Master.pool.transactionIsolation:java.sql.Connection.TRANSACTION_READ_COMMITTED}"/> </property> <!-- connection pool configuration - default values taken from HikariConfig default values --> <property name="maximumPoolSize" value="${Master.pool.maxActive:8}"/> <property name="minimumIdle" value="${Master.pool.minIdle:0}"/> </bean> <bean class="org.springframework.jdbc.datasource.init.DataSourceInitializer"> <property name="dataSource" ref="MasterDataSource"/> <property name="enabled" value="true"/> <property name="databasePopulator"> <bean class="org.springframework.jdbc.datasource.init.ResourceDatabasePopulator"> <property name="continueOnError" value="true"/> <property name="ignoreFailedDrops" value="true"/> <property name="sqlScriptEncoding" value="UTF-8"/> <property name="scripts"> <array> <value type="org.springframework.core.io.Resource"> classpath:/audit/${Master.audit.sql} </value> </array> </property> </bean> </property> </bean> <bean id="MasterEntityManagerFactory" class="org.apache.syncope.core.persistence.jpa.spring.DomainEntityManagerFactoryBean"> <property name="mappingResources"> <list> <value>${Master.orm}</value> </list> </property> <property name="persistenceUnitName" value="Master"/> <property name="dataSource" ref="MasterDataSource"/> <property name="jpaVendorAdapter"> <bean class="org.springframework.orm.jpa.vendor.OpenJpaVendorAdapter"> <property name="showSql" value="false"/> <property name="generateDdl" value="true"/> <property name="databasePlatform" value="${Master.databasePlatform}"/> </bean> </property> <property name="commonEntityManagerFactoryConf" ref="commonEMFConf"/> </bean> <bean id="MasterTransactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"> <property name="entityManagerFactory" ref="MasterEntityManagerFactory"/> <qualifier value="Master"/> </bean> <tx:annotation-driven transaction-manager="MasterTransactionManager"/> </beans>
© 2015 - 2024 Weber Informatics LLC | Privacy Policy