I have entity Prop_alquiler with association
/**
* @ManyToMany(targetEntity="Prop_feature")
* @JoinTable(name="baires_props_alquiler_features",
* joinColumns={@JoinColumn(name="prop_id", referencedColumnName="id")},
* inverseJoinColumns={@JoinColumn(name="feature_id", referencedColumnName="id")}
* )
*/
private $features;
Now the idea is filter specifics Prop_feature id in createQuery sentence, the obvious problem with
JOIN p.features f WHERE f.id IN(1,2,...)
is that a Prop_alquiler has several Prop_features so the same Object Prop_alquiler will be repeated.
There is a simple way to make a ???
WHERE p.features IN(key values)
I was silly, its very simple, in case of filters use
GROUP BY p.id
Thats it, hope this help anyone with the same wrong concept