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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T09:42:06+00:00 2026-05-13T09:42:06+00:00

I have two tables: CalendarEntry Id Date … Holiday Id Date … In my

  • 0

I have two tables:

CalendarEntry
  Id
  Date
  ...

Holiday
  Id
  Date
  ...

In my CalendarEntry class, I have a property like this

public ISet<Holiday> Holidays { ... }

which I want to associate to the Holiday instances that occur on the same Date as the CalendarEntry. However, I can’t come up with how to do this.

I’ve tried mapping it as one-to-many, but one-to-many automatically assumes that it should perform the join using CalendarEntry‘s Id column (presumably since it’s the only property that is guaranteed to be unique, which it must be to be one-to-many).

I’ve tried mapping it as many-to-many, but it seems that many-to-many requires a separate join table, which I don’t want in this case.

My question is: is it possible to map this in NHibernate, and how should I do it? If it’s not possible, why?

  • 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-13T09:42:06+00:00Added an answer on May 13, 2026 at 9:42 am

    I think what you need to do is set up a query to get the Holiday entries. I’m not sure this can be done using a mapping.


    Additional info from my original answer, which may not apply: You can have the many-to-many relationship in NHibernate without creating a separate entity class for the join table entries, but the underlying data still needs to exist somewhere in the database.

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

Sidebar

Related Questions

I have two tables which look like the following tools : id | part
I have two tables looking like this: A B id_attr value id id_attr value
I have two tables built like this (this is just a simplified and non-proprietary
I have two tables and want to compare rows on sqlite like this table1
I have two tables Users and Companies: public class User { // Properties public
I have two tables: projects and supplies. Projects have many supplies, like this: has_many
I have two tables like this: [tblFacilityHrs] id uid title description [tblFacilityHrsDateTimes] owner_uid startEventDate
I have two tables users(id, username, password) and user_badges(user_id, badge_id, badge_slot) I would like
I have two tables: users and user_depts. Let's say (for this question) that users
I have two tables with this structure: Table one: ID Description Table two: ID

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.