Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Learning NHibernate 4
  • Table Of Contents Toc
  • Feedback & Rating feedback
Learning NHibernate 4

Learning NHibernate 4

By : Suhas H Chatekar
3.6 (9)
close
close
Learning NHibernate 4

Learning NHibernate 4

3.6 (9)
By: Suhas H Chatekar

Overview of this book

This book targets .NET developers who have never used an ORM before, developers who have used an ORM before but are new to NHibernate, or have used NHibernate sparingly and want to learn more about NHibernate.
Table of Contents (13 chapters)
close
close
12
Index

Fetching strategies



Lazy loading is about "when associated entities are loaded". There is another angle to loading associated entities which is about "how associated entities are loaded". The latter is controlled by a feature called fetching strategy. A simple example here would help. Suppose you want to retrieve all benefit records for a particular employee. There are different ways of doing this. For instance, following are two different SQL queries that I can think of to retrieve benefit records:

  • You can use a join between Employee and Benefit table

  • You can just select from the Benefit table using a WHERE clause that limits the records by matching foreign key column Employee_Id to the ID of the employee record

NHibernate supports three different ways of fetching associations. Through fetching strategy you can tell NHibernate which way it should use for a particular association. From optimization point of view, this is a good lever to use. Fetching strategy is declared as part of mapping...

Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Learning NHibernate 4
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist download Download options font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon