Hello,
I have a class that is using a composite-element for a many-to-many relationship with an extra column:
class Product {
productId;
ICollection<AditionalPropertyProduct> adProps;
}
class AditionalPropertyProduct {
value;
Product prod;
AditionalProperty prop;
}
class AditionalProperty {
code;
description;
}
Now I have to search those products that has some specific values for some specific adition property.
the resulting query should be something like
select * from Product where exists (select * from Product.adProps ad where ad.prop.code='MyCustomProp' and ad.value='20')
I tried different combinations like detached queries (getting a "No persister for") like Explresion.SQL in the ICriteria with no luck.
Is there anyone that faced this problem already?
Thanks,
Fernando
|