Hibernate Exception:Illegal use of @FilterJoinTable on an association




Asked on February 22, 2015
Hi All,

I am  using @FilterJoinTable in my hibernate application to filter collection load as below.

@OneToMany
@JoinColumn(name="stdId")
@FilterJoinTable(name="stdMinId", condition=":minId >= stdId")
private Set<Students> students;

and getting exception as below. How to correct it.

Caused by: org.hibernate.AnnotationException: Illegal use of @FilterJoinTable on an association without join table
at org.hibernate.cfg.annotations.CollectionBinder.bindFilters(CollectionBinder.java:918)
at org.hibernate.cfg.annotations.CollectionBinder.bindOneToManySecondPass(CollectionBinder.java:863)
at org.hibernate.cfg.annotations.CollectionBinder.bindStarToManySecondPass(CollectionBinder.java:779)
at org.hibernate.cfg.annotations.CollectionBinder$1.secondPass(CollectionBinder.java:728)
at org.hibernate.cfg.CollectionSecondPass.doSecondPass(CollectionSecondPass.java:70)
at org.hibernate.cfg.Configuration.originalSecondPassCompile(Configuration.java:1697)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1426)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1846)






Replied on February 22, 2015
@FilterJoinTable is used with @JoinTable annotation in hibernate. Follow the link as below.



Write Answer










©2024 concretepage.com | Privacy Policy | Contact Us