测试语法错误???
You have an error in your Sql syntax;check the manual that corresponds to your MySql server version fro the right syntax to use near'( ORDER order0_where exists(select orderitems1_
public class OrderTest { Session session = null; @Test public void testWhere1() { String hql = "from Order o where o.orderItems is not empty"; Query query = session.createQuery(hql); List<Order> list = query.list(); for (Order order : list) { System.out.println(order.getCustomer().getName()); System.out.println(order.getAmount()); System.out.println(order.getTradeDate()); } } @Before public void setUp() throws Exception { session = HibernateSessionFactory.getCurrentSession(); } @After public void tearDown() throws Exception { session.close(); } }
.ID from ORDERITEM orderitems1_ w' at line 1