how can I do this :
SELECT c.categoriesThemes FROM Categorie c WHERE c.url = :url AND c.categoriesThemes.id != 5
This is problematic : c.categoriesThemes.id != 5
thank you in advance
how can I do this :
SELECT c.categoriesThemes FROM Categorie c WHERE c.url = :url AND c.categoriesThemes.id != 5
This is problematic : c.categoriesThemes.id != 5
thank you in advance
SELECT c.categoriesThemes FROM Categorie c WHERE c.url = :url AND c.categoriesThemes.id <> 5
Presuming the item type you want is CategoryTheme
and the category's property name is category
, you'd need a query kind of like this
SELECT ct FROM CategoryTheme ct WHERE ct.category.url = :url AND ct.id <> 5
Basically, you are trying to select from the wrong table.
So, i have create a bidirectionnel and now, this request is ok
SELECT ct FROM CategorieTheme ct JOIN ct.categorie c WHERE c.url = :url AND ct.id <> 5
But not this :
SELECT c.categoriesThemes FROM Categorie c JOIN c.categoriesThemes ct WHERE c.url = :url AND ct.id <> 5
Why ?