Different querying methods

NHibernate supports more than one way of retrieving entities from database. These different ways are built at different times with each new implementation adding something new that was not present in the earlier methods. While new ways of querying entities added new features, in most cases, some of the existing features were also lost. In this section, we will try to get a quick overview of these different methods and understand the key differences between them.

Native SQL

NHibernate supports writing queries in native SQL supported by your database. While this feature is available, do not use it generously. Two main reasons this feature is provided are:

  • There is a need to utilize database specific features that are not ...

Get Learning NHibernate 4 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.