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

  • Home
  • SEARCH
  • 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 4023668
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T10:37:36+00:00 2026-05-20T10:37:36+00:00

I have entity fluently mapped to existing oracle view: public class MyEntityMap : ClassMap<MyEntity>

  • 0

I have entity fluently mapped to existing oracle view:

public class MyEntityMap : ClassMap<MyEntity>
{
    public class MyEntityMap()
    {
        ReadOnly();
        SchemaAction.None();
        //mappings
    }
}

I’m querying oracle view for entities and filtering them based on certain criteria, let’s say, where created_date more than 14 days. Those entities should be written into the database for future reporting use. For that purpose I’ve created a table which is exact clone of oracle view in terms of fields. And I’d like to map exactly the same MyEntity to my own table. Something like that:

public class MyHistoricalEntityMap : ClassMap<MyEntity>
{
    public class MyHistoricalEntityMap()
    {
        Table("HistoricalEntities");
        //mappings
    }
}

Also, I have a service responsible for querying view, but I want to add a method to store my historical entities, smth like below:

public class MyEntityService : IMyEntityService
{
    private IRepository<MyEntity> _repository;
    ...    
    public IEnumerable<MyEntity> GetEntities(){...}    
    public void StoreHistoricalEntities(IEnumerable<MyEntity> historicalEntities) {...}
}

So, question is: how do I specify, that I want to (or nhibernate should) use MyEntityMap for querying, but MyHistoricalEntityMap for storing results? Or what other solution can I apply?

Thanks,

  • 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-20T10:37:37+00:00Added an answer on May 20, 2026 at 10:37 am

    You can’t use two different mappings for an entity.

    What you can do is use custom SQL for loading.

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

Sidebar

Related Questions

I have Entity set and i create partial class [Bind(Include = ID,Note,Spec,Retired)] [MetadataType(typeof(SomeClass))] public
I have entity class which is used to model a weather station, and it
I have Entity class with datetime filed, I want to select distinct 'mon-yyyy' format
I have Entity type class(Serializable, loaded and saved data at runtime) where user specified
I have entity classes and these entity classes implement their own equals() function, which
I have entity A. Entity B inherits entity A. For entity B there are
I have one entity object (kind) for storing all information from user's advertisement. It
I'm using entity framework 4.1 and can't add the connection on linqpad, it says
I'm having some trouble getting NHV to work with Fluent NHibernate. A unit test

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.