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

The Archive Base Latest Questions

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

Reverse engineering an existing database to map with N-Hibernate using Fluent N-Hibernate. How can

  • 0

Reverse engineering an existing database to map with N-Hibernate using Fluent N-Hibernate.

How can I map this?

Address table

Id
Address1
Address2

Person table

Id
First
Last

Types

Id
TypeName

PersonAddress table (A person can have home, business etc addresses)

Id

PersonId (Id from person table)

AddressId (Id from address table)

TypeId (Id from types lookup table HOME, BUSINESS etc..)

Any help would be great. Thanks

Here’s another tricky one in addition to above mapping. Don’t know how easy it would be to map it.

Party Table

Id
Person Id points to Person

Identifiers Tables

Id
Party Id
Type Id
Identifier value

Employee table

Employee Id No party or person table has foreign key to this table. The employee id is stored in the
identifiers table. so for e.g. The identifier table is used store values for different types. The identifiers for a given party could DriverLicense, EmployeeId, SSN, Credit Card numeber etc, this could be many values.

Sample identifier data

Id, PartyId, TypeId, IdentifierValue

1 , 1, 1, EMPLID-1234
2 , 2, 1, EMPLID-4567
3 , 3, 1, EMPLID-34354

I am trying to get my head around this and just can’t get it to mapped.

  • 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-15T09:47:04+00:00Added an answer on May 15, 2026 at 9:47 am
    // this answer assumes you have functional Address, Person, Type, and PersonAddress objects.
    
    public class AddressMap : ClassMap<Address>
    {
      public AddressMap()
      {
        Id(x=>x.Id);
        Map(x=>x.Address1);
        Map(x=>x.Address2);
      }
    }
    
    public class PersonMap : ClassMap<Person>
    {
       public PersonMap()
       {
         Id(x=>x.Id);
         Map(x=>x.First);
         Map(x=>x.Last);
       }
    }
    
    public class TypeMap : ClassMap<Type>
    {
       public TypeMap()
       {
         Id(x=>x.Id);
         Map(x=>x.TypeName);
       }
    }
    
    public class PersonAddressMap : ClassMap<PersonAddress>
    {
       public PersonAddressMap()
       {
         Id(x=>x.Id);
         References(x=>x.Person, "PersonId");
         References(x=>x.Address, "AddressId");
         References(x=>x.Type, "TypeId");
       }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Visio 2007 support reverse engineering a MSSQL Database. However, SQL2008 is not supported (
I am using NetBeans 6.5.1 and Hibernate 3.2.5. I stepped through this tutorial by
Any code-analysis or reverse-engineering tool that can do either of these?: Calculate which classes
I am interested in how the reverse-engineering on java bytecode is conducted. Can anyone
Hello How would one go about reverse engineering a page such as the this
I am reverse engineering an app and I need to see what is in
I’m looking for a Perl ORM library that has support for reverse engineering of
I have decided that I really need to get some flowcharts for reverse engineering
I was thinking about a tool to inspect objects at runtime, primarily for reverse-engineering
I want to reverse engineer (import into diagram form) the database definition dump 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.