level 5
有一个多对多的映射,三张表
书本表 b_id b_name b_price
分类表 c_id c_name
中间表 b_id c_id
通过Hibernate生产实体类和映射文件
Book{
int id;
String name;
double price;
Set categories;
}
Category{
int id;
String name;
Set books;
}
现在有这样一个要求 希望通过页面选择一个分类和价格,查询出所有符合条件的书本
对应的hql语句要怎么写?
2013年07月09日 08点07分
1
level 8
select bc.book from Bc bc where bc.category.id=? and bc.book.price=?
2013年07月09日 09点07分
2