Hibernate: limit query with one-to-many

前端 未结 5 2124
暗喜
暗喜 2020-12-10 19:48

For example, I have the Service entity:

@OneToMany(fetch = FetchType.EAGER, mappedBy = \"service\")
pu         


        
5条回答
  •  不知归路
    2020-12-10 20:05

    You can use Restrictions.le("date2",date2) and Restrictions.gt("date1",date1) while querying. see this link.

    http://www.mkyong.com/hibernate/hibernate-criteria-examples/

    following is also very useful

    http://docs.jboss.org/hibernate/orm/3.3/reference/en/html/querycriteria.html

提交回复
热议问题