我有一个抽象实体,多次扩展,每个子实体都有自己的重复字段 当我使用父字段搜索时,这可行,但是当我通过子字段时发生错误
employeeRepository.findAll(EmployeeSpecification.filterField(null,null,null),pageable).getContent();
错误1
Caused by: org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token: where near line 1, column 206 [select distinct generatedAlias0 from de.mexchange.packagingdb.entity.Employee as generatedAlias0 where exists (select distinct treat(generatedAlias0 as de.mexchange.packagingdb.entity.EmployeeThird) from where treat(generatedAlias0 as de.mexchange.packagingdb.entity.EmployeeThird).other like :param0)]
at org.hibernate.hql.internal.ast.QuerySyntaxException.convert(QuerySyntaxException.java:91)
at org.hibernate.hql.internal.ast.ErrorCounter.throwQueryException(ErrorCounter.java:109)
at org.hibernate.hql.internal.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:304)
at org.hibernate.hql.internal.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:203)
at org.hibernate.hql.internal.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:158)
at org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:131)
at org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:93)
at org.hibernate.engine.query.spi.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:167)
at org.hibernate.internal.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:301)
at org.hibernate.internal.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:236)
at org.hibernate.internal.SessionImpl.createQuery(SessionImpl.java:1836)
at org.hibernate.jpa.spi.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:568)
错误2
Caused by: java.lang.IllegalArgumentException: Unable to locate Attribute with the the given name [other] on this ManagedType