【发布时间】:2013-08-05 21:32:19
【问题描述】:
我有两个表:作者和书籍。 Authors 有两个列:int id、varchar authorName。 Books 有三列:int id、varchar bookName、int authorId。
现在考虑到我将 authorName 作为输入字符串过滤条件,我怎样才能让 hibernate 只返回某个作者的书?
【问题讨论】:
-
你提到了排序。排序意味着将许多项目按特定顺序放置。您真的想在这里对任何内容进行排序,还是只想按名称过滤?
-
@TomAnderson 对不起,我的意思是过滤
标签: hibernate jpa hibernate-criteria