Overview

Entity Developer for NHibernate supports the named SQL queries feature of NHibernate. Named SQL queries can be defined in the model and enable execution of regular SQL queries. Native SQL queries support named parameters, i.e. SQL queries can be parameterized. Entity Developer interprets named SQL queries as methods of the model, for which a helper class containing the corresponding C# or Visual Basic methods will be generated. This allows working with queries with all possible convenience, as wrapper methods are strongly typed, are found by IntelliSense and have the corresponding signature.

For creating and editing methods in Entity Developer, the Method Editor dialog is used:

images_Method_Editor_NH

The Parameters tab of the Method Editor dialog provides the possibility to specify and edit parameters of a parameterized query:

images_Method_Editor_NH2

Refer to the corresponding sections for the examples showing how to work in Entity Developer with the most frequent cases of using the named SQL query. They are: query without result, query with scalar result and query with entity result (e.g. a SELECT query to a table).

 

ExpandedToggleIcon        See Also


Send feedback on this topic

© 2008 - 2024 Devart. All rights reserved.