Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 539613
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T10:09:15+00:00 2026-05-13T10:09:15+00:00

In a hierarchical data model i have Parent and Child. Parent has Fields[] and

  • 0

In a hierarchical data model i have Parent and Child. Parent has Fields[] and each child will also have the same “Count” of fields.. we’ll call them ChildField[]

public class Parent : ActiveRecordBase<Parent>
{
   [HasMany]
   IList<Field> Fields {get; set;}
   [HasMany]
   IList<Child> Children {get; set;}
}

public class Child : ActiveRecordBase<Child>
{
   [HasMany]
   IList<ChildField> ChildFields {get; set;}
}

Now when you don’t have any Fields inside Parent… but i have say 500 Child objects in its collection I sure dont want 500 selects (total) where each child tries to load its childField collection.

I suppose I can maybe do Lazy but at the same time.. when there are childFields I don’t want it lazy and eager is going to be more performant isn’t it?

ActiveRecordMediator might allow me to go something like

public void FetchByChild(Child child){    
child.Parent.Fields.Count > 0
       //Do the fetch
    else
       //return;
}

Does the mediator serve the purpose to “skip” db calls when additional knowledge of the “calling-context” is provided?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T10:09:15+00:00Added an answer on May 13, 2026 at 10:09 am

    The question is a bit confusing… ActiveRecordMediator is only a NHibernate ISession accessor. It can’t skip queries or anything like that. It only executes the queries that you feed it.

    In NHibernate (and ActiveRecord of course) you can use lazy or eager fetching on a per-query basis. That is, if for a particular query you know you’ll need those Child entities you can fetch them eagerly. If you don’t, let them be lazy.

    These articles are a great introduction to lazy/eager loading:

    • http://nhforge.org/wikis/howtonh/lazy-loading-eager-loading.aspx
    • http://www.castleproject.org/activerecord/documentation/trunk/advanced/tuning.html

    There are also other perf tweaks you can do, like batch fetching for collections

    If you meant setting your fetch strategy from an external context, see these articles:

    • http://www.udidahan.com/2007/04/23/fetching-strategy-design/
    • http://www.udidahan.com/2007/09/16/fetching-strategy-nhibernate-implementation-available/
    • http://ayende.com/Blog/archive/2008/03/27/Adaptive-Domain-Models-with-Rhino-Commons.aspx
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some hierarchical data - each entry has an id and a (nullable)
I have hierarchical data in a nested set model (table:projects): My table (projects): id,
I have hierarchical data stored in the datastore using a model which looks like
Trying to model some highly connected, but also hierarchical data in app engine. Here
I love the nested-set model for storing hierarchical data, and I'd like to find
I have an MVC view with a partial view recursive call that displays hierarchical
I read this http://mikehillyer.com/articles/managing-hierarchical-data-in-mysql/ and in nested set model I want retrieve from parent
I am doing hierarchical data binding on a grid, and I need to have
I have a deep hierarchical model that looks like this: Accounts -> Venues ->Events
I'm trying to set up a hierarchical data model with a container in Core

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.