java - QueryDSL to get any entities in a collection of another entity -


i'm using jpa hibernate , querydsl (v.4.0.5). have entity:

package com.test.model.entity;  @entity public class article {     @id     private long id;      @manytomany(fetch = lazy, cascade = detach)     private set<tag> tags; } 

how can find articles matching given set of tags? think should start follows:

public booleanexpression hastag(set<tag> tags){     final qarticle article = qarticle.article;     return article.tags.any().eqany(ce); } 

where ce should collectionexpression. have no idea how set this.

any solution?

did try

public booleanexpression hastag(set<tag> tags){     qarticle article = qarticle.article;     return article.tags.any().in(tags); } 

Comments

Popular posts from this blog

matlab - error with cyclic autocorrelation function -

django - (fields.E300) Field defines a relation with model 'AbstractEmailUser' which is either not installed, or is abstract -

c# - What is a good .Net RefEdit control to use with ExcelDna? -