谁能帮我解决这个棘手的问题,我已将 jpacontainer 设置为 vaadin 组合框的数据源,并为其设置了过滤模式,但过滤不起作用,它在这里抛出异常。
代码:
JPAContainer<PersonMaster> personMasterContainer = new JPAContainer<>(PersonMaster.class);
personMasterContainer.setEntityProvider(dataService.getPersonMasterService());
ComboBox createEntitySelect = new ComboBox("Entity",personMasterContainer);
createEntitySelect.setContainerDataSource(personMasterContainer);
createEntitySelect.setItemCaptionPropertyId("personName");
createEntitySelect.setFilteringMode(ComboBox.FILTERINGMODE_CONTAINS);
createEntitySelect.setImmediate(true);
异常堆栈跟踪:
SEVERE: EjbTransactionUtil.handleSystemException: The filter listener "matches" requires a constant argument.
<openjpa-2.4.0-r422266:1674604 nonfatal user error> org.apache.openjpa.persistence.ArgumentException: The filter listener "matches"requires a constant argument.
at org.apache.openjpa.jdbc.kernel.exps.JDBCExpressionFactory.matches(JDBCExpressionFactory.java:276)
at org.apache.openjpa.persistence.criteria.Expressions$Like.toKernelExpression(Expressions.java:1265)
at org.apache.openjpa.persistence.criteria.PredicateImpl.toKernelExpression(PredicateImpl.java:166)
at org.apache.openjpa.persistence.criteria.CriteriaExpressionBuilder.evalFilter(CriteriaExpressionBuilder.java:215)
at org.apache.openjpa.persistence.criteria.CriteriaExpressionBuilder.getQueryExpressions(CriteriaExpressionBuilder.java:75)
at org.apache.openjpa.persistence.criteria.CriteriaQueryImpl.getQueryExpressions(CriteriaQueryImpl.java:423)
at org.apache.openjpa.persistence.criteria.CriteriaBuilderImpl.eval(CriteriaBuilderImpl.java:81)
at org.apache.openjpa.kernel.ExpressionStoreQuery$DataStoreExecutor.<init>(ExpressionStoreQuery.java:763)
at org.apache.openjpa.kernel.ExpressionStoreQuery.newDataStoreExecutor(ExpressionStoreQuery.java:179)
at org.apache.openjpa.kernel.QueryImpl.createExecutor(QueryImpl.java:748)
at org.apache.openjpa.kernel.QueryImpl.compileForDataStore(QueryImpl.java:706)
at org.apache.openjpa.kernel.QueryImpl.compileForExecutor(QueryImpl.java:688)
at org.apache.openjpa.kernel.QueryImpl.getOperation(QueryImpl.java:1528)
at org.apache.openjpa.kernel.DelegatingQuery.getOperation(DelegatingQuery.java:123)
at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:268)
at org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:290)
at org.apache.openjpa.persistence.QueryImpl.getSingleResult(QueryImpl.java:318)
at com.vaadin.addon.jpacontainer.provider.LocalEntityProvider.doGetEntityCount(LocalEntityProvider.java:543)
at com.vaadin.addon.jpacontainer.provider.LocalEntityProvider.getEntityCount(LocalEntityProvider.java:547)
at sun.reflect.GeneratedMethodAccessor66.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)