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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T11:39:04+00:00 2026-05-15T11:39:04+00:00

I knew nHibernate does not support UNION. But there are some tricks, we can

  • 0

I knew nHibernate does not support UNION. But there are some tricks, we can implement the same like :

  1. Using raw-sql
  2. Using sub-union class

I have an old application which is using <join table></join table> Now, I want to implement UNION here.

Here are the file(s) in application:

file: .hbm.xml

<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"> 
<class name="">
<id name="Id" column="ID" type="Int32">
</id>
<!--Some properties are here -->    
<property name="" column=""/>
<!--Relations -->
<many-to-one name="" column="" lazy="false"/>
<bag name="" inverse="false" lazy="false" cascade="none">
  <key column="ID" />
  <one-to-many class="" />
</bag>
<join table="CAIMainDB.dbo.TClaimOnline">
  <key column="ID" foreign-key="ID"/>
  <property name="" column=""/>      
</join>
    </class>
</hibernate-mapping>

file: mapper.cs

<!-- Here I need to implement HQL or Raw SQL to achieve UNION -- >

file: Domain class

<!-- This contains the properties to set the aliases or map with columns -- >    
public virtual int Id { get; set; }

I appreciate if anyomne suggest me how to implement in the current scenario of my application.

  • 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-15T11:39:05+00:00Added an answer on May 15, 2026 at 11:39 am

    Do you really need to do a union? If you’re getting objects back from the database, then is it sufficient to concatenate the collections returned?

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

Sidebar

Related Questions

does anyone know if you can do something like this using the (N)Hibernate criteria
I knew there is a JQuery form validation, but if there is no form,
I am using ASP.NET-MVC and nHibernate for the first time. Great tools, but big
im using hibernate xml to map my databse, but i didn't knew how to
I knew that we can set innodb as engine tables. But can we add
I knew of some performance reasons back in the SQL 7 days, but do
I knew layoutopt tools through the dev guide,but I can't find layoutopt tools in
I knew mvn:package can be used to generate JAR or WAR, is there any
I knew that we can create child themes for wordpress. But i want to
Does anyone know if there is an alternative to using attributes on C# properties

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.