Recent Additions To My NHibernate Examples

4 commentsWritten on May 8th, 2011 by
Categories: NHibernate

I've been pretty busy lately with the prep-work for my NHibernate course and my NHibernate examples, which the course leans on pretty heavily. Below is a list of examples that have been added in the past few weeks:

  • optimistic concurrency
    • optimistic-lock="all"
    • optimistic-lock="dirty"
    • version
  • pessimistic locking
  • performance
    • executable hql (updates/deletes)
    • extra lazy collection
    • futures
    • paging through collections
    • proxies
  • querying
    • aggregate functions (HQL/Criteria/LINQ/QueryOver)
    • eager fetching (HQL/Criteria/LINQ/QueryOver)
    • group by (HQL/Criteria/LINQ/QueryOver)
    • ordering (HQL/Criteria/LINQ/QueryOver)
    • paging (HQL/Criteria/LINQ/QueryOver)
    • polymorphism (HQL/Criteria/LINQ/QueryOver)
    • projections (HQL/Criteria/LINQ/QueryOver)
    • restrictions (HQL/Criteria/LINQ/QueryOver)
    • subqueries (HQL/Criteria/LINQ/QueryOver)
    • unique results (HQL/Criteria/LINQ/QueryOver)
    • native sql
    • stored procedures

And there's quite a bit more to come in the next 2 weeks or so...

The examples now also run on SQL Server with both Fluent NHibernate as well as normal mapping files. If you're interested, you can get them here.

  • Pingback: The Morning Brew - Chris Alcock » The Morning Brew #847

  • http://ceilidhboy.myopenid.com/ Mike Scott

    This may have been discussed in the past, but I note your Entity class GetHashCode() function returns a different hash depending on whether the instance is transient or not.

    This will cause problems if a transient instance is used as a key in a dictionary or other hash-based container and is subsequently saved, altering its hash.

    I acknowledge that using an entity as a key in a dictionary is unlikely, but is this sufficient? If so, shouldn’t there at least be a warning somewhere?

    • http://davybrion.com Davy Brion

      if the hashcode implementation is wrong, you don’t only run into problems when using the entity as a key in a dictionary, but simply with storing it in a set as well… that is, storing it in a set works, trying to remove it won’t

      the GetHashCode implementation that i use actually saves the hashcode in case it’s a transient instance, and when it is subsequently retrieved after an ID has been set, it will use the previously stored hashcode value… exactly to avoid these problems :)  

  • sinful bikinis

    That additional fold of materials may help support your expanding midsection. Maternity bikinis are obtainable in an extremely broad variety of the quantity of fabrics very much like conventional bathing suits. among the probably the most common fabrics for these fits is cotton. even although Armani bathing suit cotton attributes a amazingly gentle sensation it may possibly not have cheap billabong bikinis as very much expand when you would like it to. You may also locate cotton crafted maternity bikinis that attribute some lycra from the cotton mix. this billabong bikinis sale could be Ed hardy swimsuit ordinarily a exceptional option largely since it allows your bikini to develop along collectively with your midsection without armani swimwear any dropping its armani bikinis problem and ability to mold for Armani swimsuits the shape. consider treat that you just don’t choose a materials that is as well tight in your cheap Armani bikinis tummy. You do not need to constrict your tummy. moreover you billabong bikinis 2011 must acquire cautious of choosing a swimsuit that carries billabong swimwear a seam or elastic near for the tummy that helps make you really feel limited.Bikinis have invariably been a warm favored in any women’s wardrobe