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 6110605
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:32:05+00:00 2026-05-23T14:32:05+00:00

I have an object graph that looks like this: class A () { int

  • 0

I have an object graph that looks like this:

class A ()
{
   int id;
   IEnumerable<B> bees;
}

class B()
{
   int id;
   A a;
   C c;
}

class C()
{
   int id;
   D d;
   IEnumerable<B> bees;
}

class D()
{
   int id;
   IEnumerable<C> cees
}

What would be a sensible approach for constructing a query which:

returns a list of A types, where they contain D down the chain with a particular id?

I’m using NH3, so can use any of the query techs. I’ve tried a couple of different approaches, but have hit seemingly dead ends in each case. I have a solution working with in memory collections – but obviously this is not ideal, I want the work done on the DB server.

  • 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-23T14:32:06+00:00Added an answer on May 23, 2026 at 2:32 pm
    select distinct a from A a
    inner join a.bees b
    inner join b.c c
    where c.d.id = :theSearchDId
    

    That is assuming that all the associations are bidirectional associations, and not unrelated associations (i.e. A.bees is the inverse association of B.a, etc.).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The situation is this: You have a Hibernate context with an object graph that
I have a pretty sizeable object graph that I have serialized to a file
I have this object graph, I want to map: abstract Account (username, password, ...)
I have a hash object, whose structure looks similar to this: {:category1 => {:subcategory1
I have a problem.... Lest say I have a class like this one: public
I have an object graph serialized to xaml. A rough sample of what it
So I have an object graph, let's just say it's an order. You have
I have an object that is mapped to a cookie as a serialized base-64
I have an object in a multi-threaded environment that maintains a collection of information,
I have an object of class F. I want to output the contents of

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.