Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在我的网络项目中使用 Hibernate Criteria API。目前我陷入了一个严重的问题。我有以下情况。
我想获取特定学校的所有学生(例如 S_ID=1),但无法这样做。问题是我不知道要为标准添加什么限制。
尝试:
session.createCriteria(Student.class).createAlias("your_class_property", "class").createAlias("class.your_school_property", "school").add(Restrictions.eq("school.id", 1)).list()