我试图获取在DeatachedCriteria中找到的所有元素,但是当我尝试执行该条件时,我得到一个错误。
ORA-00907:缺少右括号
如果我从createAlias中删除JoinType,它可以工作,但我需要将此联接设置为LEFT_OUTER_JOIN
。
有什么想法为什么休眠无法正确创建SQL查询?
DetachedCriteria subquery = DetachedCriteria.forClass(getDomainClass())
.createAlias("installationPeriods", "installationPeriods", JoinType.LEFT_OUTER_JOIN)
.createAlias("certifications", "certifications", JoinType.LEFT_OUTER_JOIN)
.createAlias("certifications.certificationsStatus", "certificationsStatus", JoinType.LEFT_OUTER_JOIN)
.createAlias("installationStatus", "installationStatus", JoinType.LEFT_OUTER_JOIN)
.setProjection(Projections.alias(Projections.property("id"), "id"));
Criteria criteria = getSession().createCriteria(getDomainClass())
.setResultTransformer(Criteria.ROOT_ENTITY)
.add(Subqueries.propertyIn("id", subquery));
addPaginatorInCriteriaBy(criteria, new PaginatorFilter(first, max, sortColumn, sortOrder));
List<Installation> list = criteria.list();