以前用的是sqlserver,现在该为mysql,数据库连接上了,但是以前写的查询报错了
——————————————————
select userinfo0_.id as id0_, userinfo0_.company_name as company2_0_, userinfo0_.user_name as user3_0_,
userinfo0_.mobile_number as mobile4_0_ from Demo.dbo.user_info userinfo0_,Demo.dbo.user_info去掉dbo就可以查询出来,请问要如何解决呢?
[code="java"]
public int queryAll() {
// TODO Auto-generated method stub
String hql="from UserInfo";
List list = getHibernateTemplate().find(hql);
[/code]
[code="java"]
org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute query; SQL [select userinfo0_.id as id0_, userinfo0_.company_name as company2_0_, userinfo0_.user_name as user3_0_, userinfo0_.mobile_number as mobile4_0_ from Demo.dbo.user_info userinfo0_]; nested exception is org.hibernate.exception.SQLGrammarException: could not execute query
org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:629)
org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412)
org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:411)
org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374)
org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTemplate.java:912)
org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTemplate.java:904)
com.seamoon.demo.dao.impl.UserInfoDAOImpl.queryAll(UserInfoDAOImpl.java:181)
[/code]