hql左联查询报错
代码如下:
Query query = session
.createQuery("from TbBooktypeson left join TbBook on TbBooktypeson.bookId=TbBook.bookId where TbBooktypeson.bookId="+id);
mysql语句可以运行(语句如下):
select tb_book.author,tb_book.title,tb_booktypeson.type_name from tb_booktypeson
left join tb_book on tb_booktypeson.book_id=tb_book.book_id
where tb_booktypeson.id=6;
运行结果报错:
org.hibernate.hql.internal.ast.ErrorCounter reportError
ERROR: line 1:58: unexpected token: on