/// <summary>
/// 批量删除
/// </summary>
/// <param name="hql">删除操作语句</param>
/// <param name="param">参数集合</param>
public void DeleteBatch(string hql, object[] param)
{
IQuery query = Session.CreateQuery(hql);
if (param != null)
{
for (int i = 0; i < param.Length; i++)
{
query.SetParameter(i, param[i]);
}
}
query.ExecuteUpdate();
}毕业论文http://www.751com.cn/
/// <summary>
/// 查询语句
/// </summary>
/// <param name="hql">查询语句</param>
/// <param name="param">参数集合</param>
/// <returns>对象集合</returns>
public IList<T> QueryObject(string hql, object[] param)
{
IQuery query = Session.CreateQuery(hql);
if (param != null)
{
for (int i = 0; i < param.Length; i++)
{
query.SetParameter(i, param[i]);
}
}
return query.List<T>();
}
/// <summary>
/// 查询语句原文请+QQ324,9114辣'文'论;文'网
/// </summary>
/// <param name="hql">查询语句</param>
/// <param name="param">参数集合</param>
/// <returns>对象</returns>
public object QueryUniqueResult(string hql, object[] param)
{
IQuery query = Session.CreateQuery(hql);
if (param != null)
{
for (int i = 0; i < param.Length; i++)
{
query.SetParameter(i, param[i]);
}
}
return query.UniqueResult();
}/// <summary>/// 查询分页
上一页 [1] [2] [3] [4] [5] [6] [7] [8]