Questions tagged [orm]
Object-relational mapping (ORM) is a technique for mapping between object-oriented systems and relational databases.
279 questions
1 vote
2 answers
262 views
How to Handle Data Persistence In Domain Driven Design
I am currently reading about domain-driven design and n-tier architecture with a service layer, and comparing them to try to understand how each architecture is executed. For n-tiers (specifically 3-...
12 votes
5 answers
8k 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
3 answers
230 views
Should security and data validation be implemented within database or application?
I am building a simple web app where one set of users have varying admin privileges who can write to database and the other set can only view data. I am used to securing APIs with JWT or session ...
1 vote
0 answers
47 views
Separating Typeorm Entities from Domain Entities [duplicate]
Is it a bad approach to add domain logic inside typeorm entities if following the domain model pattern to organize business logic. import { Entity, PrimaryGeneratedColumn, Column } from "typeorm&...
0 votes
1 answer
340 views
Approach for store multiple relationships POO objects in relational database
I'm developing a system in which a ClassA object can have multiple ClassB and ClassC objects. And for store these objects in a relational DB model I create the following tables: This is a simplified ...
2 votes
1 answer
3k views
How to organize ORM models and business logic
I have a Python application using SQLAlchemy. It uses around 15 database tables. For example, I have an image table that lists image files manipulated by the application. Most operations involving ...
3 votes
2 answers
1k views
Read-only view to reference other Aggregate Roots
In his book Implementing Domain-Driven Design Vaughn Vernon suggests to reference other aggregate roots only by identity and not by reference, like this: // Aggregate Root class Order( val ...
2 votes
1 answer
352 views
Is it a good design to have separate Hibernate entities for general user info and user password digest?
I'm developing an app with a user management system. There is a database table named user with the following columns: | Column Name | Column Type | |-----------------|-------------| | userId ...