6.ibatis的映射文件
< xml version="1.0" encoding="UTF-8" >
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
SELECT
COUNTRY
FROM
USER
WHERE
USERNAME like '%$username$%'
AND
TRIM(COUNTRY) = #country#
SELECT
USERNAME,
PASSWORD
FROM
USER
COUNTRY = #country#
order by $preferedOrder$
7.spring的配置文件
< xml version="1.0" encoding="UTF-8" >
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" 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-2.5.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd"> class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> class="org.apache.commons.dbcp.BasicDataSource"> value="${jdbc.driverClassName}" /> class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"> org.hibernate.dialect.MySQLDialect class="org.springframework.orm.hibernate3.HibernateTransactionManager"> expression="execution(public * com.whm.service..*.*(..))" /> advice-ref="txAdvice" />
摘自 wang_huanming的专栏