摘要:
异常:org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'sessionFactory' is defined (sessionFactory没有定义)在web.xml中配置OpenSessionInViewFilter时应该指定SessionFactory的名字,配置如下:HibernateOpenSessionorg.springframework.orm.hibernate3.support.OpenSessionInViewFiltersessionFactory 阅读全文
posted @ 2013-06-20 16:35
Kent_fighting
阅读(1139)
评论(0)
推荐(0)
摘要:
public boolean checkUserExistsWithName(String username) {SessionFactory sf = HibernateUtil.getSessionFactory();Session s = sf.getCurrentSession();s.beginTransaction();long count = (Long)s.createQuery("select count(*) from User u where u.username=:username").setString("username",u 阅读全文
posted @ 2013-06-20 16:29
Kent_fighting
阅读(572)
评论(0)
推荐(0)
浙公网安备 33010602011771号