nhibernate記事

  • code mapping proc
  •  var result = session.CreateSQLQuery("exec GetMemberGameActivity :mToken, :StartDate, :EndDate") .SetResultTransformer(Transformers.AliasToBean()) .SetParameter("mToken", token) .SetParameter("StartDate", startDate) .SetParameter("EndDate", endDate) .List().ToList();
  • mysql  參數用 ? ,SetParameter可採用index方式賦值
  • 清除指定緩存
  • sessionFactory.Evict(typeof(Cat), catId); //evict a particular Cat sessionFactory.Evict(typeof(Cat)); //evict all Cats sessionFactory.EvictCollection("Eg.Cat.Kittens", catId); //evict a particular collection of kittens sessionFactory.EvictCollection("Eg.Cat.Kittens"); //evict all kitten collections
相關文章
相關標籤/搜索