I have a many-to-many relation, having P
, PF
and F
I want to filter P
using F
through PF
. Like:
final query = Query<P>(context)
..where( (p)=>p.pfSet.firstWhere( (pf)=>pf.f.cod == 1 ).f ).isNotNull();
and the classes:
class P extends ManagedObject<_P> implements _P {}
class _P{
@primaryKey
int cod;
...
ManagedSet<ProdutoFilial> pfSet;
}
class PF extends ManagedObject<_PF> implements _PF {}
class _PF{
@primaryKey
int cod;
@(Relate #pfSet)
P p;
@(Relate #pfSet)
F f;
bool active;
}
class F extends ManagedObject<_F> implements _F {}
class _F{
@primaryKey
int cod;
...
ManagedSet<ProdutoFilial> pfSet;
}
How can I filter this?