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

The Archive Base Latest Questions

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

I have an Events table whose goal is to store actions done by web

  • 0

I have an Events table whose goal is to store actions done by web site users. An action basically alters or create a new row in a table X. This will allow me to store an history of all actions done by a user. As such, Events contains:

  • a primary key column
  • a text to describe the event (ex: ‘posted a comment’)
  • a discrimator column if needed
  • a foreign key column to another table A
  • a foreign key column to another table B
  • ….
  • a foreign key column to another table N

A row in the Events table will have only one of the foreign key columns set, all others will be null (so they are all nullable). The table behaves like an indirection table to the actual table concerned by the event. I don’t know if a discriminator is needed since all the information is contained in the foreign key columns. Tables A to N can be anything. Their domain model class can have a common interface if necessary (IEventRecordable).

My question is: Is a mapping possible between the Events table and an Event class? Is it especially feasible with fluent nhibernate? Can it be done without having to create many derived classes of Event (I don’t want to create so many empty subclasses)? The Event class would ideally be as follows:

public class Event {     public virtual int Id { get; set; }     public virtual IEventRecordable ActualEvent { get; set; }     public virtual string EventDescription { get; set; }     DateTime EventDateTime { get; set; } } 

Many classes among the domain model classes could implement IEventRecordable (which is mainly an empty interface). It could be the User table or a BlogComment table…

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. 2026-05-11T00:39:16+00:00Added an answer on May 11, 2026 at 12:39 am

    If you forget about the multiple foreign key columns, you can make this an <any> mapping.

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

Sidebar

Related Questions

I have a mysql database table that will store locations for buildings and events
I have an events table with a 'featureEvent' boolean column. I need to display
I have an Events table with a not-null date field. Based on a pivot
I have 2 tables events and events_visibility events table and the column id -
Suppose I have a table events {id, userid, create_time, country, type, page, browser} I
I have a database table of events. Each event has a category and a
I have one table which contains events and dates, and another which contains the
I have a table of data which represents a series of events that persons
I have a MySQL table containing a listing of events that I am trying
I have a table containing a series of names, events and dates. I've created

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.