All Questions
Tagged with database-design orm
21
questions
12
votes
5
answers
7k
views
Is it an anti-pattern to create ORM entities based on existing database schema?
I maintain a large legacy app working with SQL database. The app uses raw SQL queries to query the database. Together with app rewrite I plan to introduce ORM to work with the database.
The simplest ...
0
votes
1
answer
67
views
Mapping of time based models to database
Currently I'm developing a movie reservation system for diving into Spring Framework.
I'm using Spring Data JPA for database modeling. I have several model classes but I am stuck with time-based logic ...
0
votes
1
answer
71
views
Calculating time an object stays in a state
I use Python sqlalchemy to store my model in a MySql database. One of my objects has a 'state' field (for simplicity let's assume there are two states: AVAILABLE and UNAVAILABLE).
There are ...
2
votes
2
answers
2k
views
Ways to store objects, inherited from one superclass in a database
For my personal project I need to store 2D shapes in a Postgres database. For example Circle, Pentagon, Rectangle and so on. At first I've done it like so: all shapes are inherited from an abstract ...
2
votes
1
answer
2k
views
Table Per Concrete Type in Entity Framework Core
I'm trying to port code from entity framework 6 (EF6) to entity framework core 2.0 (EF-Core) and have ran into a dead end.
In my EF6 code, I have a base class called Record which defines the base ...
3
votes
3
answers
3k
views
Role based Database Schema
I am designing a database for a document management app for my office. I want to get the backend right so I don’t have issues in the future. Basically all users will be categorized into roles e.g, ...
1
vote
1
answer
758
views
Doubt about representing a Shopping Cart in Class Diagram/ER Database implicating ORM
I have to do a task which is reading a text, and create a Class diagram. One of the entities is a Shopping Cart.
My doubt is how to represent a Shopping Cart in a class diagram, later on an E/R ...
1
vote
0
answers
119
views
Is a topological sort required here?
Say you are writing an ORM like entity framework. You write basic POCO, and then let entity framework do the job of creating equivalent structures in the database according to those objects.
This ...
1
vote
0
answers
41
views
Database Constraint from another table column
Let's consider the following objects :
Article which can be of different types
Equipment which point to an Article, some fields on equipment are only used for some types.
I want to add constraint ...
4
votes
1
answer
668
views
What happens to database design process when ORM tools are used?
I have learned about database design, including normalization during my undergraduate course. When we have to model a database for a system, we can start with an ER model and then convert it to the ...
1
vote
1
answer
3k
views
Class Table Inheritance: do child tables need a primary key?
I'm using the Class Table Inheritance architecture with my application and have read Fowler. When mapping my database tables to classes in code, I've realized I have no need for an "ID" property on ...
0
votes
0
answers
74
views
Managing allocation calendars for an employee set [duplicate]
IN view of creating a MIS (Management Information System) one architectural/design issue that's confronting us is managing allocation for set of employees.
Scenario:
Employees get allocated to ...
7
votes
4
answers
839
views
Heterogeneous Associations - Data Modeling When an Object that Must Relate to One of Many Classes
Suppose you have 3 classes: ClassA, ClassB and ClassC. Now suppose you have a class Message. You want a one-to-many relationship between each one of those three classes and the Message.
The goal is ...
1
vote
1
answer
99
views
How to associate both a collection and one item of this collection to an entity
I'm working on a project in which I have an entity, we may call Users and another entity Address.
I want to define the entity User in a way that an user would have a collection of addresses (...
1
vote
0
answers
98
views
Extending database model of ORM in subproject
I have a maven project which contains some entities which are stored in a database. The purpose of this project is to manage personal information, users, locations, etc. This project can work on its ...