使用getHibernateTemplate().find返回null,求大神看看我的xml文件有没有问题啊
<?xmlversion="1.0"encoding="UTF-8"?><beansxmlns="http://www.springframework.org/schem...
<?xml version="1.0" encoding="UTF-8"?>
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"></property>
<property name="url" value="jdbc:sqlserver://localhost:1433;DatabaseName=BBS"></property>
<property name="username" value="sa"></property>
<property name="password" value="sa"></property>
<property name="maxActive" value="100"></property>
<property name="maxIdle" value="30"></property>
<property name="maxWait" value="500"></property>
<property name="defaultAutoCommit" value="true"></property>
</bean>
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource"></property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</prop>
<prop key="hibernate.show_sql">true</prop>
</props>
</property>
<property name="mappingResources">
<list>
<value>com/bbs/po/BoardManagerTable.hbm.xml</value>
<value>com/bbs/po/BoardType.hbm.xml</value>
<value>com/bbs/po/CommentTable.hbm.xml</value>
<value>com/bbs/po/InvitationTable.hbm.xml</value>
<value>com/bbs/po/ManagerTable.hbm.xml</value>
<value>com/bbs/po/UserInfoTable.hbm.xml</value>
</list>
</property>
</bean>
<bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate">
<property name="sessionFactory">
<ref bean="sessionFactory"/>
</property>
<property name="allowCreate">
<value>true</value>
</property>
</bean>
<bean id="userInfoDao" class="com.bbs.dao.UserInfoDaoImpl" scope="singleton">
<property name="sessionFactory">
<ref bean="sessionFactory"/>
</property>
</bean>
<bean id="userLoginService" class="com.bbs.service.userLoginService">
<property name="uiDao" ref="userInfoDao"></property>
</bean>
<bean id="UserLoginAction" class="com.bbs.action.UserLoginAction" scope="prototype">
<property name="uesrLogSer" ref="userLoginService"></property>
</bean>
</beans> 展开
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"></property>
<property name="url" value="jdbc:sqlserver://localhost:1433;DatabaseName=BBS"></property>
<property name="username" value="sa"></property>
<property name="password" value="sa"></property>
<property name="maxActive" value="100"></property>
<property name="maxIdle" value="30"></property>
<property name="maxWait" value="500"></property>
<property name="defaultAutoCommit" value="true"></property>
</bean>
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource"></property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</prop>
<prop key="hibernate.show_sql">true</prop>
</props>
</property>
<property name="mappingResources">
<list>
<value>com/bbs/po/BoardManagerTable.hbm.xml</value>
<value>com/bbs/po/BoardType.hbm.xml</value>
<value>com/bbs/po/CommentTable.hbm.xml</value>
<value>com/bbs/po/InvitationTable.hbm.xml</value>
<value>com/bbs/po/ManagerTable.hbm.xml</value>
<value>com/bbs/po/UserInfoTable.hbm.xml</value>
</list>
</property>
</bean>
<bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate">
<property name="sessionFactory">
<ref bean="sessionFactory"/>
</property>
<property name="allowCreate">
<value>true</value>
</property>
</bean>
<bean id="userInfoDao" class="com.bbs.dao.UserInfoDaoImpl" scope="singleton">
<property name="sessionFactory">
<ref bean="sessionFactory"/>
</property>
</bean>
<bean id="userLoginService" class="com.bbs.service.userLoginService">
<property name="uiDao" ref="userInfoDao"></property>
</bean>
<bean id="UserLoginAction" class="com.bbs.action.UserLoginAction" scope="prototype">
<property name="uesrLogSer" ref="userLoginService"></property>
</bean>
</beans> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询