문제

I tried to use the hibernate filters with seam. However it thrown below exception

17:09:37,154 ERROR [STDERR] org.hibernate.HibernateException: No such filter configured [contributorTypeFilter]
        at org.hibernate.impl.SessionFactoryImpl.getFilterDefinition(SessionFactoryImpl.java:965)
        at org.hibernate.impl.SessionImpl.enableFilter(SessionImpl.java:1032)
        at org.jboss.seam.persistence.HibernateSessionProxy.enableFilter(HibernateSessionProxy.java:133)

Entity

  @OneToMany(cascade = CascadeType.ALL, mappedBy = "wfEntity")
  @OrderBy(value="orderNum")
  @JoinTable
  @FilterJoinTable(name  = "ccTypeFilter", condition  = "'CC' == WF_TYPE")
  private List<WFContEO> wfCCRoles;

  @OneToMany(cascade = CascadeType.ALL, mappedBy = "wfEntity")
  @OrderBy(value="orderNum")
  @JoinTable
  @FilterJoinTable(name  = "contTypeFilter", condition  = "'CONT' == WF_TYPE")
  private List<WFContEO> wfConts;

DAOImpl

public EntityEO findById(Long id) {
    getSession().enableFilter("contTypeFilter");
    getSession().enableFilter("ccTypeFilter");
    return (EntityEO) getSession().
          createCriteria(EntityEO.class).                                 createCriteria("wf").add(Restrictions.idEq(wfId)).uniqueResult();
  }

It throws error when enabling filter. Is there are any documentation available for How to use FilterJoinTable? Any XML configuration is required?

도움이 되었습니까?

해결책

Exception is not thrown, when i remove @JoinTable.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top