Hi,
I am using a named SQL query to retrieve some report information and trying to cache the result in a table so I don't have to calculate again, but I have trouble to save the result in a database table.
Here is what I am trying to do:
IQuery query = session.GetNamedQuery("my named query");
query.SetInt32("parameter", value);
IList result = query.List();
foreach (myObject item in result)
{
session.Save(item);
}
myObject is mapped with NHibernate and I tried using an identity ID, assigned ID, as well as composite-id but none of them worked and NHibernate just not generated the insert query.
Any body has done similar or has any idea on how this can possibly be done?
Thanks.
|