private static ISession _session ;
public IList<int> list()
{
using (_session = factory.Session)
{
IQuery querys = _session.CreateQuery(“select id from news”);
return querys.List<int>();
}
}
private static ISessionFactory _factory;
static object obj = new object();
public ISession Session
{
get
{
if (_factory == null)
{
lock (obj)
{
if (_factory == null)
{
Configuration cf = new Configuration().Configure();
_factory = cf.BuildSessionFactory();
}
}
}
return _factory.OpenSession();
}
}
Could not execute query[SQL: SQL not available] 在return querys.List<int>(); 中报的,本人是nhibernate新手,请指教下。
看innerException...