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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.