-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: cannot recreate collection while filter is enabled
PostPosted: Mon Dec 10, 2012 9:58 am 
Newbie

Joined: Mon Dec 10, 2012 9:39 am
Posts: 1
After running JUnit test [while commiting] i got this exception:
Caused by: org.hibernate.HibernateException: cannot recreate collection while filter is enabled: .......OrgUnit.children#4]

I have filter enabled at the OrgUnit entity itself:
Code:
@Filter(name=FilterConstant.NOT_CANCELED_ITEMS, condition="state <> 'CANCELED'")
and also at child definition:
Code:
    @ManyToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
    @JoinTable(name = "Parent_Child_OU",
            joinColumns = @JoinColumn(name = "childId", referencedColumnName = "id"),
            inverseJoinColumns = @JoinColumn(name = "parentId", referencedColumnName = "id"))
    private List<OrgUnit> parents;

    @ManyToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL, mappedBy = "parents")
    @Filter(name=FilterConstant.NOT_CANCELED_ITEMS, condition="state <> 'CANCELED'")
    private List<OrgUnit> children;

Is it needed to specify @IndexColumn at children property? (requires some more work at inserts)
Is there any other solution?
Am I doing some mistake?
I use Hibernate 4.1.4.Final, though i expect this to be version independent.
Any answers would be greatly appreciated.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.