如何使用Hibernate的HQL和Criteria api表达此查询?
选择CITIES。*来自CITIES的CITIES.STATE_ID(来自STATES WHATES STATES.COUNTRY_ID = 78的STATES.STATE_ID)
编辑:
这是课程
Country.java
Integer id;
String name;
State.java
Integer id;
Integer countryId;
String name;
City.java
Integer id;
Integer stateId;
String name;
我想要获得属于某个国家的所有城市(例如,那个id = 78的城市)
没有找到相关结果
已邀请:
2 个回复
钨蜡唤喉晤
第二个是使用带有交叉连接的hql。看看这里。 最后我认为最好用本机sql编写这个查询。 ;)
物崎巩