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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T07:44:07+00:00 2026-05-11T07:44:07+00:00

I am trying to build a messaging system and for this i have the

  • 0

I am trying to build a messaging system and for this i have the table definition below

Message

Id From To Body ParentId // Subcollection, i want to get Asnwers (Message.ParentId== Message.Id) IsRead 

and i have this in the Message.cs

IList<Message> Answers; 

I have tried this but it gives me all the messages and all the answers in the main collection.

But i dont want answers to be seen like a message (like the main item).

<hibernate-mapping xmlns='urn:nhibernate-mapping-2.2' assembly='RealEstate.Core' namespace='RealEstate.Core.Domain'>   <class name='Message' table='Message' lazy='true'>     <id column='id' type='Int64' name='Id'>       <generator class='native' />     </id>     <property name='From' column='[From]' type='Int64' />     <property name='To' column='[To]' type='Int64' />     <property name='Body' column='Body' />     <property name='ParentId' column='ParentId' type='Int64' />     <property name='SenderType' column='SenderType' type='Byte' />     <property name='IsRead' column='IsRead' type='Boolean' />      <bag name='Answers' lazy='true' cascade='delete'>       <key column='ParentId' />       <one-to-many class='Message'/>     </bag>    </class> </hibernate-mapping> 

How can this mapping be done, they are in the same table ?

Thank you very much

  • 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. 2026-05-11T07:44:08+00:00Added an answer on May 11, 2026 at 7:44 am

    You want to map a tree ? Maybe this could help: how to map a tree in nhibernate

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

Sidebar

Related Questions

Im currently using codeigniter to build a messaging system and im trying to stay
I have a std::vector< tr1::shared_ptr<mapObject> > that I'm trying build from data contained in
I am trying to build a messaging/chat system. which can store conversation between two
I am trying to build a MySQL, PHP, Ajax based personal messaging system. There
Backgroun: I'm trying to build a private messaging system in Mysql with conv view.
im trying to create a simple private messaging system i have a nested route
I was trying Build For Archiving application (from Titanium Mobile) with xCode 4.4, but
I'm trying build a method which returns the shortest path from one node to
Trying to build openssl-fips-2.0 with NDK, before I was lucky found this link and
Trying to build sslsniff on a RHEL 5.2 system here. When compiling sslsniff on

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.