sql 语句 select * from product as p inner join storeinfodetail as sd on p.id=sd.product where p.name like '%PS%'
解决方案 »
- GUI的相关问题
- 求 inputstream 的内容读到 byte数组中的代码
- jtable表中的数据如何另存到Excel表
- 时间计算问题:根据已知的一个时间比如2005-2005-02-12计算15天前的时间是什么时候?
- J2SE里的默认连接池
- 在开发过程中操作系统的选择
- 100分! 求助:怎样安装java1.2 Runtime Environment and Set the Path environment
- 多线程问题,20分
- 请问 SimpleDateFormat.applyPattern有啥用哈?
- 关于javaSwing中图标标签问题
- 如何让JComboBox的右边的下拉按钮变得没有边框?
- Oracle 10g操作异常,很奇怪,大家快来围观。。
select p from product as p inner join storeinfodetail as sd on p.id=sd.product where p.name like '%PS%'product storeinfodetail 都得是对象名
hibernate两表必须有管理关系!否则不可用join hql中join 不需要on 应为配置文件中定义了管理关系!
我上面写的storeinfodetail 必须为product 的属性也就是说1-1 or 1-n关系!!
例:
user.java
public class User{
private int id;
private Set books = new HashSet(0);
...get set
}
public class Book{
private int id;
private User user;
...get set
}hql:from User a left join a.books where a.id=?