那位有Hibernate的技术文档发我一份。最好中文的。谢谢!

解决方案 »

  1.   

    static public IList GetAllNews()
    {
    ISessionFactory factory = HibernateSession.SessionFactory;
    ISession session = factory.OpenSession(); IList list = session.Find("from News "); session.Close(); return list;
    }
    从类News 取100条,该如何写啊?
      

  2.   

    To,rickyelf(elf)
    用过这个东东,给点技术文档或帮助信息,我刚刚在研究这个谢谢!找到了,原来如此。// 取类中的前100条数据
    ICriteria crit = sess.CreateCriteria(typeof(News));
    crit.SetMaxResults(100);
    List cats = crit.List();// 得到当前类的row行数
    IEnumerable countEn = session.Enumerable("select count(*) from ....");
    countEn.MoveNext();
    int count = (int) countEn.Current;
      

  3.   

    那个东西用过,但是没有SQL或HQL好用