[hibernate-dev] Filters and many to many
    Emmanuel Bernard 
    emmanuel at hibernate.org
       
    Thu Sep 28 14:51:23 EDT 2006
    
    
  
In xml to set up a filter on the target table of a many to many, you set 
the filter element inside the <many-to-many> element
To support that in annotations, I could do
1.
@Filter (pointing to the association table or the target table if a 
@OneToMany @JoinColumn)
@FilterManyToMany (@FilterTargetEntity) (pointing to the association 
table or the target table if a @OneToMany @JoinTable | @ManyToMany)
or
2.
@Filter (pointing to the target table)
@FilterJoinTable (pointing to the association table)
I like 2. better, it is more consistent esp when you realize that 
@OneToMany can use a join table just by changing an annotation.
2. would require a break to the users playing with @Filter and 
associations involving join tables.
WDYT?
Any annotation better name are welcome too.
    
    
More information about the hibernate-dev
mailing list