用
private static final String LOAD_VALID_USER = " from User user where user.name=? and user.password=? ";
public boolean isValidUser(String username, String password){
String [] userlist = new String[2];
userlist[0] = username;
userlist[1] = password;
List list = this.getHibernateTemplate().find(LOAD_VALID_USER,userlist);
if(list.size()>0){
return true;
}
return false;
}
方法就会报上面的错。
private static final String LOAD_VALID_USER = " from User user where user.name=? and user.password=? ";
public boolean isValidUser(String username, String password){
String [] userlist = new String[2];
userlist[0] = username;
userlist[1] = password;
List list = this.getHibernateTemplate().find(LOAD_VALID_USER,userlist);
if(list.size()>0){
return true;
}
return false;
}
方法就会报上面的错。
public List getAllUser() {
try{
return this.getHibernateTemplate().find(LOAD_ALL);
}catch(Exception e){
e.printStackTrace();
}
return new ArrayList();
}
<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory">
<ref local="sessionFactory"/>
</property>
</bean><bean id="userDAO" class="com.oa.test.dao.hibernate.UserDAO">
<property name ="sessionFactory">
<ref local="sessionFactory"/>
</property>
</bean><bean id="userDaoProxy" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="transactionManager">
<ref bean="transactionManager" />
</property>
<property name="target">
<ref local="userDAO" />
</property>
<property name="transactionAttributes">
<props>
<prop key="insert*">PROPAGATION_REQUIRED</prop>
</props>
</property>
</bean><bean id="userService" class="com.oa.testlogin.business.service.UserService">
<property name="userDAO">
<ref bean="userDaoProxy"/>
</property>
</bean>