<commit_before><?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed 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:context="http://www.springframework.org/schema/context"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:p="http://www.springframework.org/schema/p"
       xmlns:tx="http://www.springframework.org/schema/tx"
       xmlns:aop="http://www.springframework.org/schema/aop"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
       http://www.springframework.org/schema/beans/spring-beans.xsd
       http://www.springframework.org/schema/context
       http://www.springframework.org/schema/context/spring-context.xsd
       http://www.springframework.org/schema/p
       http://www.springframework.org/schema/p/spring-p.xsd
       http://www.springframework.org/schema/tx
       http://www.springframework.org/schema/tx/spring-tx.xsd
       http://www.springframework.org/schema/aop
       http://www.springframework.org/schema/aop/spring-aop.xsd">

    <context:annotation-config/>
    <context:component-scan base-package="org.syncope.core.persistence"/>
    <context:component-scan base-package="org.syncope.core.rest.data"/>

    <aop:aspectj-autoproxy/>
    <bean class="org.syncope.core.monitor.CacheMonitor"/>
    
    <bean id="contextApplicationContextProvider"
          class="org.syncope.core.persistence.util.ApplicationContextProvider"/>

    <bean id="propertyConfigurer"
          class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="locations">
            <list>
                <value>classpath:persistence.properties</value>
            </list>
        </property>
    </bean>

    <bean id="dbUnitDataTypeFactory" class="${dbUnitDataTypeFactory}"/>

    <bean id="xStream" class="com.thoughtworks.xstream.XStream"/>

    <!-- Use JNDI datasource as default but, when not available, revert to
         local datasource, using different properties for execution and testing -->
    <bean id="dataSource"
          class="org.springframework.jndi.JndiObjectFactoryBean">
        <property name="jndiName" value="java:comp/env/jdbc/syncopeDataSource"/>
        <property name="defaultObject" ref="localDataSource"/>
    </bean>
    <bean id="localDataSource"
          class="org.springframework.jdbc.datasource.DriverManagerDataSource">
        <property name="driverClassName" value="${hibernate.connection.driver_class}"/>
        <property name="url" value="${hibernate.connection.url}"/>
        <property name="username" value="${hibernate.connection.username}"/>
        <property name="password" value="<PASSWORD>}"/>
    </bean>

    <bean id="entityManagerFactory"
          class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
        <property name="persistenceUnitName" value="syncopePersistenceUnit"/>
        <property name="dataSource" ref="dataSource"/>
        <property name="jpaVendorAdapter">
            <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
                <property name="showSql" value="false"/>
                <property name="generateDdl" value="true"/>
                <property name="databasePlatform" value="${hibernate.dialect}"/>
            </bean>
        </property>
        <property name="jpaPropertyMap">
            <map><commit_msg>Small fix<commit_after><?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed 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:context="http://www.springframework.org/schema/context"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:p="http://www.springframework.org/schema/p"
       xmlns:tx="http://www.springframework.org/schema/tx"
       xmlns:aop="http://www.springframework.org/schema/aop"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
       http://www.springframework.org/schema/beans/spring-beans.xsd
       http://www.springframework.org/schema/context
       http://www.springframework.org/schema/context/spring-context.xsd
       http://www.springframework.org/schema/p
       http://www.springframework.org/schema/p/spring-p.xsd
       http://www.springframework.org/schema/tx
       http://www.springframework.org/schema/tx/spring-tx.xsd
       http://www.springframework.org/schema/aop
       http://www.springframework.org/schema/aop/spring-aop.xsd">

    <context:annotation-config/>
    <context:component-scan base-package="org.syncope.core.persistence"/>
    <context:component-scan base-package="org.syncope.core.rest.data"/>

    <aop:aspectj-autoproxy/>
    <bean class="org.syncope.core.monitor.CacheMonitor"/>
    
    <bean id="contextApplicationContextProvider"
          class="org.syncope.core.persistence.util.ApplicationContextProvider"/>

    <bean id="propertyConfigurer"
          class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="locations">
            <list>
                <value>classpath:persistence.properties</value>
            </list>
        </property>
    </bean>

    <bean id="dbUnitDataTypeFactory" class="${dbUnitDataTypeFactory}"/>

    <bean id="xStream" class="com.thoughtworks.xstream.XStream"/>

    <!-- Use JNDI datasource as default but, when not available, revert to
         local datasource, using different properties for execution and testing -->
    <bean id="dataSource"
          class="org.springframework.jndi.JndiObjectFactoryBean">
        <property name="jndiName" value="java:comp/env/jdbc/syncopeDataSource"/>
        <property name="defaultObject" ref="localDataSource"/>
    </bean>
    <bean id="localDataSource"
          class="org.springframework.jdbc.datasource.DriverManagerDataSource">
        <property name="driverClassName" value="${hibernate.connection.driver_class}"/>
        <property name="url" value="${hibernate.connection.url}"/>
        <property name="username" value="${hibernate.connection.username}"/>
        <property name="password" value="${<PASSWORD>}"/>
    </bean>

    <bean id="entityManagerFactory"
          class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
        <property name="persistenceUnitName" value="syncopePersistenceUnit"/>
        <property name="dataSource" ref="dataSource"/>
        <property name="jpaVendorAdapter">
            <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
                <property name="showSql" value="false"/>
                <property name="generateDdl" value="true"/>
                <property name="databasePlatform" value="${hibernate.dialect}"/>
            </bean>
        </property>
        <property name="jpaPropertyMap">
            <map>
                <entry key="hibernate.order_updates" value="true"/>

{'fraction_non_alphanumeric': 0.13456431010497028, 'fraction_numerical': 0.0030352851903376753, 'mean_word_length': 3.279220779220779, 'pattern_counts': {'":': 0, '<': 90, '<?xml version=': 2, '>': 90, 'https://': 0, 'lorem ipsum': 0, 'www.': 34, 'xml': 14}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3425571', 'n_tokens_mistral': 2194, 'n_tokens_neox': 2124, 'n_words': 399}