Hi all, i'm trying to write a CreateCriteria to manage my entities but i had some problems:
i have 6 tables to manage products and categories data with different languages:
http://hman.pastebin.com/KkpLtGfAi created entities class in my asp.net application:
http://hman.pastebin.com/b9LhFUNti created also mapping files:
http://hman.pastebin.com/JbsXf5gVquery that i would like to write should:
get t_products_descriptions order by t_products_descriptions.T_PRODUCTS_NAME
where t_products_descriptions.t_languages.t_languages_name = 'English'
and t_products_categories.t_categories.t_categories_id = <specific cat>
my problem is that t_products_descriptions and t_products_categories have ref to t_products but there isn't a direct ref from t_products_descriptions to t_products_categories, the only class that is present both classes is t_products.
i tryed
// Prepare query conditions
ICriteria criteria = session.CreateCriteria(typeof(t_products_descriptions))
.AddOrder(new Order("T_PRODUCTS_NAME", true));
ICriteria langCriteria = criteria
.CreateCriteria("T_LANGUAGES")
.Add(Expression.Eq("T_LANGUAGES_NAME", Master.globalObject.DefaultLanguage));
ICriteria catCriteria = criteria
.CreateCriteria("T_PRODUCTS")
.SetFetchMode("t_products_categories", FetchMode.Join)
.Add(Expression.Eq("prodcats.T_CATEGORIES.T_CATEGORIES_ID",
myCat.T_CATEGORIES.T_CATEGORIES_ID));
but naturally i received:
could not resolve property: prodcats of: Arkdisplayweb.Entities.t_products
Could you help me ?