All Downloads are FREE. Search and download functionalities are using the official Maven repository.

.test.test-app.0.0.3.source-code.applicationContext.xml Maven / Gradle / Ivy

The newest version!
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
	xmlns:tx="http://www.springframework.org/schema/tx"
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd
        http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd">

	<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
		destroy-method="close">
		<property name="driverClassName" value="com.mysql.jdbc.Driver" />
		<property name="url"
			value="jdbc:mysql://192.168.0.160:3306/mytest" />
		<property name="connectionProperties"
			value="useUnicode=yes;characterEncoding=utf8;" />
		<property name="username" value="liu" />
		<property name="password" value="123456" />
	</bean>

	<!-- Hibernate 3 Annotation SessionFactory Bean definition -->
	<bean id="hibernate3AnnotatedSessionFactory"
		class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
		<property name="dataSource" ref="dataSource" />
		<property name="annotatedClasses">
			<list>
				<value>tk.hongkailiu.test.app.hibernate.entity.Person</value>
				<value>tk.hongkailiu.test.app.hibernate.entity.Certificate</value>
			</list>
		</property>
		<property name="hibernateProperties">
			<props>
				<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
				<prop key="hibernate.current_session_context_class">thread</prop>
				<prop key="hibernate.show_sql">true</prop>
			</props>
		</property>
	</bean>

	<bean id="personDAO" class="tk.hongkailiu.test.app.hibernate.dao.PersonDAOImpl">
		<property name="sessionFactory" ref="hibernate3AnnotatedSessionFactory" />
	</bean>
	<bean id="certificateDAO" class="tk.hongkailiu.test.app.hibernate.dao.CertificateDAOImpl">
		<property name="sessionFactory" ref="hibernate3AnnotatedSessionFactory" />
	</bean>
</beans>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy