【发布时间】:2014-01-26 16:28:19
【问题描述】:
我有这样的映射类:
@Entity
@Table(name = "contact", catalog = "pagesjaunes")
public class Contact implements java.io.Serializable {
private Integer id;
private String name;
private Set<Phone> phones = new HashSet<Phone>(0);
[...]
}
@Entity
@Table(name = "telephone", catalog = "pagesjaunes")
public class Phone implements java.io.Serializable {
private Integer id;
private Contact contact;
private String phoneNumber;
[...]
}
我可以在Contact 上用HQL 进行类似的查询吗:
from Contact where phones.phoneNumber = 06487954
【问题讨论】: