Hi! Thanks for you answer
I find it really strange that it works in for you...
After looking at your code I noticed something, you are not using parameters, you concatenate the hql string with your composite id:
Quote:
string hql = "FROM " + type + " AS obj";
if (useEmpId)
hql += " WHERE obj.EmpId = " + Infos.EmpId;
But I use parameters (in this case ":id"):
Quote:
oe.Session.CreateQuery("from " + TypeName() + " as " + DefaultAlias() +" where " + DefaultAlias() + "." + PrimaryKeyName +" = :id");
oe.Session.SetParameter("id",someId);
I dont understand why it works for you... IMO your code shoud concatenate the "ToString()" of your composite-id class with the HQL... did you write you ToString() in a special way so that this kind of queries are possible?