问题描述
- hibernate 中写sql 的问题
-
public List findCartByOrderstatus(final String ostatus,final Users u) {
return this.getHibernateTemplate().execute(new HibernateCallback(){@Override
public List doInHibernate(Session session) throws HibernateException, SQLException {String sql="select * from Orderitem where
"+"Orderitem.order.ordersid in " +"(select order.ordersid from order WHERE order.orderstatus='待订单'
and order.usersid='402880e54811e0da014811e16e470001'";Query query=session.createSQLQuery(sql);
为什么 从第二个select 开始就有错;
应该怎样改
解决方案
你少了个括号!!!!
时间: 2024-11-29 07:28:36