HIBERNATE问题
在我使用原生SQL查询的时候!
List list = this.getSession().createSQLQuery("select {j.*} from jobs j where job_id = 1").addEntity("j",Jobs.class).list();
的时候
[Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]对象名 'jobs' 无效。
但是SAVE方法能够插入的!
后来又在*.hbm.xml写自定义SQL
<sql-query name="listJobs">
<return alias="jj" class="com.yourcompany.struts.bean.Jobs"/>
select {jj.*} from jobs where job_id = 1
</sql-query>
也还是说!
could not execute query [select jj.job_id as job1_0_, jj.job_desc as job2_0_0_, jj.min_lvl as min3_0_0_, jj.max_lvl as max4_0_0_ from jobs where job_id = 1]
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]对象名 'jobs' 无效。
还请大家指点一下呀!