<commit_before><?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">

<!--
  Service layer ApplicationContext definition for ejbtest project. Defines beans belonging
  to service layer. This context will normally be shared by all EJBs, and will be made the
  parent of the web-app's ApplicationContext, in a demand-load fashion.
  
  IMPORTANT: the names in here reflect all the various options (transactions, mostly) that are
  being tested, so bean names have transaction settings and the like in them. This is just so
  we don't get confused with all the variations.
  Do not use this style in your own applications! Bean names should not normally reflect
  something like transaction settings, since the whole point of IOC is to be able to switch thing
  around without affecting most other code. This is specially the case if the beans in question
  are programmatically requested by user code.
  
 -->
	
<beans>

	<!-- ========================= GENERAL DEFINITIONS ========================= -->

	<!-- Configurer that replaces ${...} placeholders with values from a properties file -->
	<!-- (in this case, JDBC-related settings for the dataSource definition below) -->
	<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
		<property name="location"><value>/WEB-INF/jdbc.properties</value></property>
	</bean>

	<!-- ========================= RESOURCE DEFINITIONS ========================= -->
  
	<!-- JNDI DataSource for J2EE environments -->
	<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
		<property name="jndiName"><value>java:ejbtestDS</value></property>
	</bean>

	<!-- Hibernate SessionFactory -->
	<bean id="hibSessionFactory" class="org.springframework.orm.hibernate.LocalSessionFactoryBean">
		<property name="dataSource"><ref local="dataSource"/></property>
		<property name="mappingResources">
      <list>
  			<value>ejbtest.hbm.xml</value>
        <value>org/springframework/autobuilds/ejbtest/domain/User1.hbm.xml</value>
		  </list>
		</property>
		<property name="hibernateProperties">
			<props>
				<prop key="hibernate.dialect">${hibernate.dialect}</prop>
				<prop key="hibernate.transaction.manager_lookup_class">net.sf.hibernate.transaction.JBossTransactionManagerLookup</prop>
        <prop key="hibernate.show_sql">true</prop>
			</props>
		</property>
	</bean>

  <!-- define a HibernateInterceptor instance -->
  <bean id="hibInterceptor"
        class="org.springframework.orm.hibernate.HibernateInterceptor">
    <property name="sessionFactory"><ref local="hibSessionFactory"/></property>
  </bean>

	<!-- Transaction manager that delegates to JTA for ultimate coordinate of transactions -->
	<bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager"/>
  
  <!-- ========================= PERSISTENCE DEFINITIONS ========================= -->
  
  <bean id="root-mapper" class="org.springframework.autobuilds.ejbtest.dbutil.mapper.hibernate.MapperImpl">
    <property name="sessionFactory"><ref bean="hibSessionFactory"/></property><commit_msg>add better comment<commit_after><?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">

<!--
  Service layer ApplicationContext definition for ejbtest project. Defines beans belonging
  to service layer. This context will normally be shared by all EJBs, and will be made the
  parent of the web-app's ApplicationContext, in a demand-load fashion.
  
  IMPORTANT: the names in here reflect all the various options (transactions, mostly) that are
  being tested, so bean names have transaction settings and the like in them. This is just so
  we don't get confused with all the variations.
  Do not use this style in your own applications! Bean names should not normally reflect
  something like transaction settings, since the whole point of IOC is to be able to switch thing
  around without affecting most other code. This is specially the case if the beans in question
  are programmatically requested by user code.
  
 -->
	
<beans>

	<!-- ========================= GENERAL DEFINITIONS ========================= -->

	<!-- Configurer that replaces ${...} placeholders with values from a properties file -->
	<!-- (in this case, JDBC-related settings for the dataSource definition below) -->
	<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
		<property name="location"><value>/WEB-INF/jdbc.properties</value></property>
	</bean>

	<!-- ========================= RESOURCE DEFINITIONS ========================= -->
  
	<!-- JNDI DataSource for J2EE environments -->
	<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
		<property name="jndiName"><value>java:ejbtestDS</value></property>
	</bean>

	<!-- Hibernate SessionFactory -->
	<bean id="hibSessionFactory" class="org.springframework.orm.hibernate.LocalSessionFactoryBean">
		<property name="dataSource"><ref local="dataSource"/></property>
		<property name="mappingResources">
      <list>
  			<value>ejbtest.hbm.xml</value>
        <value>org/springframework/autobuilds/ejbtest/domain/User1.hbm.xml</value>
		  </list>
		</property>
		<property name="hibernateProperties">
			<props>
				<prop key="hibernate.dialect">${hibernate.dialect}</prop>
        <prop key="hibernate.show_sql">true</prop>
        <!-- the transaction manager lookup is needed to allow a Hibernate Session to be bound to the
             CMT transaction (through JTA) when no Spring transaction is present -->
				<prop key="hibernate.transaction.manager_lookup_class">net.sf.hibernate.transaction.JBossTransactionManagerLookup</prop>
			</props>
		</property>
	</bean>

  <!-- define a HibernateInterceptor instance -->
  <bean id="hibInterceptor"
        class="org.springframework.orm.hibernate.HibernateInterceptor">
    <property name="sessionFactory"><ref local="hibSessionFactory"/></property>
  </bean>

	<!-- Transaction manager that delegates to JTA for ultimate coordinate of transactions -->
	<bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager"/>
  
  <!-- ========================= PERSISTENCE DEFINITIONS ========================= -->
  
  <bean id="root-mapper" class="org.springframework.autobuilds.ejbtest.dbutil.mapper.hibernate.MapperImpl">
    <property name="sessionFactory"><ref bean="hibSessionFactory"/></property>
{'fraction_non_alphanumeric': 0.1631259484066768, 'fraction_numerical': 0.0015174506828528073, 'mean_word_length': 4.662371134020619, 'pattern_counts': {'":': 0, '<': 120, '<?xml version=': 2, '>': 120, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 6}, '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': '537979', 'n_tokens_mistral': 1888, 'n_tokens_neox': 1734, 'n_words': 507}