๐๏ธ Defining Entities
Entities are simple javascript objects (so called POJO) without restrictions and without the need to extend base classes. Using entity constructors works as well - they are never executed for managed entities (loaded from database). Every entity is required to have a primary key.
๐๏ธ Modeling Entity Relationships
There are 4 types of entity relationships in MikroORM:
๐๏ธ Type-Safe Relations
Entity relations are mapped to entity references - instances of the entity that have at least the primary key available. This reference is stored in the identity map, so you will get the same object reference when fetching the same document from the database.
๐๏ธ Inheritance Mapping
Mapped Superclasses
๐๏ธ Embeddables
Support for embeddables was added in version 4.0
๐๏ธ Composite Primary Keys
Support for composite keys was added in version 3.5
๐๏ธ JSON Properties
Defining JSON properties
๐๏ธ Custom Types
You can define custom types by extending Type abstract class. It has several optional methods: