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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T22:32:41+00:00 2026-05-20T22:32:41+00:00

What rules should i follow in order map efficiently entities from my domain model

  • 0

What rules should i follow in order map efficiently entities from my domain model to a database table?

Should database columns be aligned with domain class properties?

For example i have a Database table

Person {(varchar)FirstName, (varchar)LastName, int(age)}

And a Domain class

class Person(){

String firstName;
String lastName;
int age;
}
  • Should the class and the table
    contain the same number of properties
  • Should they be of the same corresponding
    type (e.g : varchar – string)
  • What are the best practices
  • What to avoid?
  • 1 1 Answer
  • 3 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-20T22:32:41+00:00Added an answer on May 20, 2026 at 10:32 pm

    There are many strategies for object-relational mapping. Ultimately you have to represent every piece of persistent data in a field somewhere, so your strategy will work. Other questions you’ll have to answer:

    1) How are your records keyed? Are you going to have a unique ID field for each class?

    2) How will you handle inheritance? If you have a PersonA(Person) class that introduces an additional field, will you create a whole new table for every field in Person + PersonA, or just have a PersonA table for the additional field?

    3) How are you planning to construct queries against the database? Are you going to provide some form of object-query mapping?

    There are many open source ORMs out there, so unless you’re doing this for a research project, I’d advise that you use one of them.

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

Sidebar

Related Questions

Starting a new big C multiplatform project, what rules should one follow to avoid
What rules or tips should I follow to enable a function to use NRV
What are the rules I should follow to ensure GetHashCode() method returns unique value
I want to create a pattern for my string: It should follow this rules:
I need to ensure that a input string follows these rules: It should contain
I have to set some routing rules in my php application, and they should
I want to implement the SRX Segmentation Rules using javascript to extract sentences from
I have a table which stores 'links' between 2 people. In order prevent further
I have polygon given by the points sequence I need to apply follow rules:
Elements dequeued from a priority queue follow the rule that: Priority[i] >= Priority[i -

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.