<?xml version="1.0" encoding="Windows-31J"?>

<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">

<beans>

<!-- ============================================ Data Source Configuration -->

	<bean id="livezDataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
		<property name="jndiName" value="java:comp/env/jdbc/livez" />
	</bean>

<!-- 
	<bean id="livezDataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
		<property name="driverClassName" value="org.postgresql.Driver" />
		<property name="url" value="jdbc:postgresql://localhost:5432/livez" />
		<property name="username" value="postgres" />
		<property name="password" value="postgres" />
		<property name="defaultAutoCommit" value="false" />
		<property name="defaultReadOnly" value="false" />
		<property name="initialSize" value="5" />
		<property name="maxActive" value="500" />
		<property name="maxIdle" value="10" />
		<property name="minIdle" value="5" />
		<property name="maxWait" value="0" />
		<property name="validationQuery" value="SELECT current_timestamp" />
		<property name="poolPreparedStatements" value="true" />
		<property name="removeAbandoned" value="true" />
		<property name="removeAbandonedTimeout" value="30" />
		<property name="logAbandoned" value="true" />
	</bean>

	<bean id="livezDataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
		<property name="driverClassName" value="com.mysql.jdbc.Driver" />
		<property name="url" value="jdbc:mysql://localhost:3306/livez?autoReconnect=true&amp;useUnicode=true&amp;characterEncoding=Windows-31J" />
		<property name="username" value="root" />
		<property name="password" value="" />
		<property name="defaultAutoCommit" value="false" />
		<property name="defaultReadOnly" value="false" />
		<property name="initialSize" value="5" />
		<property name="maxActive" value="100" />
		<property name="maxIdle" value="10" />
		<property name="minIdle" value="5" />
		<property name="maxWait" value="0" />
		<property name="validationQuery" value="SELECT current_timestamp" />
		<property name="poolPreparedStatements" value="true" />
		<property name="removeAbandoned" value="true" />
		<property name="removeAbandonedTimeout" value="30" />
		<property name="logAbandoned" value="true" />
	</bean>
 -->


<!-- ==================== Data Mapper and Transaction Manager Configuration -->

	<!-- ========================================== Hibernate Configuration -->

	<bean id="livezSessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
		<property name="dataSource" ref="livezDataSource" />
		<property name="hibernateProperties">
			<props>
				<prop key="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</prop>
<!--
				<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
				<prop key="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</prop>
				<prop key="hibernate.dialect">org.hibernate.dialect.MySQLMyISAMDialect</prop>
-->
				<prop key="hibernate.show_sql">true</prop>
				<prop key="hibernate.format_sql">true</prop>
				<prop key="hibernate.max_fetch_depth">2</prop>
				<prop key="hibernate.default_batch_fetch_size">8</prop>
				<prop key="hibernate.default_entity_mode">pojo</prop>
				<prop key="hibernate.order_updates">true</prop>
				<prop key="hibernate.generate_statistics">true</prop>
				<prop key="hibernate.use_identifer_rollback">true</prop>
				<prop key="hibernate.use_sql_comments">false</prop>
				<prop key="hibernate.cache.use_minimal_puts">true</prop>
				<prop key="hibernate.cache.use_query_cache">false</prop>
				<prop key="hibernate.cache.use_second_level_cache">false</prop>
				<prop key="hibernate.cache.use_structured_entries">false</prop>
			</props>
		</property>
		<property name="mappingResources">
			<list><value>jp/sourceforge/livez/dao/hibernate/livez.hbm.xml</value></list>
		</property>
	</bean>

	<bean id="livezTransactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
		<property name="sessionFactory" ref="livezSessionFactory" />
	</bean>


	<!-- ============================================= iBATIS Configuration -->

<!-- 
	<bean id="livezSqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
		<property name="configLocation" value="/WEB-INF/SqlMapConfig.xml" />
		<property name="dataSource" ref="livezDataSource" />
	</bean>

	<bean id="livezTransactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
		<property name="dataSource" ref="livezDataSource" />
	</bean>
-->

<!-- ============================= Transaction Proxy Template Configuration -->

	<bean id="debug" class="org.springframework.aop.interceptor.DebugInterceptor" />

	<bean id="livezTransactionProxyTemplate" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean" lazy-init="true">
		<property name="transactionManager" ref="livezTransactionManager" />
		<property name="transactionAttributes">
			<props>
				<prop key="save*">PROPAGATION_REQUIRED,timeout_10</prop>
				<prop key="update*">PROPAGATION_REQUIRED,timeout_10</prop>
				<prop key="delete*">PROPAGATION_REQUIRED,timeout_10</prop>
				<prop key="*">PROPAGATION_REQUIRED,timeout_10,readOnly</prop>
			</props>
		</property>
		<property name="postInterceptors" ref="debug" />
	</bean>


<!-- ================================================ Generator Definitions -->

	<!-- =================================== i-mode Generator Configuration -->

	<bean id="imodeGenerator" class="jp.sourceforge.livez.imode.ImodeGenerator" singleton="false">
		<property name="imodeDAO">
			<bean class="jp.sourceforge.livez.dao.hibernate.ImodeDaoImpl" singleton="false">
				<property name="sessionFactory" ref="livezSessionFactory" />
			</bean>
<!--
			<bean class="jp.sourceforge.livez.dao.ibatis.ImodeDaoImpl" singleton="false">
				<property name="sqlMapClient" ref="livezSqlMapClient" />
			</bean>
-->
		</property>
	</bean>


	<!-- ==================================== EZweb Generator Configuration -->

	<bean id="ezwebGenerator" class="jp.sourceforge.livez.ezweb.EZwebGenerator" singleton="false">
		<property name="ezwebDAO">
			<bean class="jp.sourceforge.livez.dao.hibernate.EZwebDaoImpl" singleton="false">
				<property name="sessionFactory" ref="livezSessionFactory" />
			</bean>
<!--
			<bean class="jp.sourceforge.livez.dao.ibatis.EZwebDaoImpl" singleton="false">
				<property name="sqlMapClient" ref="livezSqlMapClient" />
			</bean>
-->
		</property>
	</bean>

	<!-- ================================= Vodafone Generator Configuration -->

	<bean id="vodafoneGenerator" class="jp.sourceforge.livez.vodafone.VodafoneGenerator" singleton="false">
		<property name="vodafoneDAO">
			<bean class="jp.sourceforge.livez.dao.hibernate.VodafoneDaoImpl" singleton="false">
				<property name="sessionFactory" ref="livezSessionFactory" />
			</bean>
<!--
			<bean class="jp.sourceforge.livez.dao.ibatis.VodafoneDaoImpl" singleton="false">
				<property name="sqlMapClient" ref="livezSqlMapClient" />
			</bean>
-->
		</property>
	</bean>

	<!-- ===================================== BREW Generator Configuration -->

	<bean id="brewGenerator" class="jp.sourceforge.livez.brew.BrewGenerator" singleton="false" />


<!-- ===================================================== Site Definitions -->

	<!-- ======================================== i-mode Site Configuration -->
<!--
	<bean id="imodeSite" class="jp.sourceforge.livez.cp.imode.ImodeSite">
		<property name="siteId" value="IMODESITEID" />
		<property name="registerURL" value="/i/reg" />
		<property name="releaseURL" value="/i/rel" />
		<property name="defaultNextURL" value="/" />
		<property name="defaultArg1" value="" />
		<property name="defaultArg2" value="" />
	</bean>
-->

</beans>
