查主外键多个表的语句,为什么执行时候没有数据显示出来,求帮忙看看
final String hql = "from news ne,Newtype nt where ne.newtype.newTypeId=nt.newTypeId";//查询语句
这个是查询语句
news表的字段
private Integer newId;
private province province;
private city city;
private Newtype newtype;
private county county;
private String newTitle;
private String newContent;
private String newTime;
private String startTime;
private String endTime;
private String source;
private String editor;
NewType表的字段
private Integer newTypeId;
private String newTypeName;
private Set<news> newses = new HashSet<news>();
求解怎么查询出来 hql
[解决办法]
select * from news ne,Newtype nt where ne.newtype=nt.newTypeId