ORM
  • Introduction
  • Basics of Usage
    • Connecting to the Database
    • Creating a Model
    • Simple Queries
  • Configuration
  • Core Features
    • Models
    • CRUD Operations (Create, Read, Update, Delete): examples
    • Relationships
    • Transactions
  • Advanced Usage
    • Data Definition Language
    • Indexes
    • Triggers
    • Caching
  • Examples and templates
  • Security
    • Query parameterization and protection against SQL injections
    • Logging
    • Monitoring
    • Sanitization
  • ORM-CLI
    • Installing
    • Commands and usage
  • System architecture and implementation
    • Support of various databases
      • Implementation using a pattern strategy
      • Implementation using generics
      • Implementation using metaprogramming
    • Decorators
    • Migrations
      • Assignment of id in Tables and Columns
      • Assigning IDs to indexes and triggers
      • Working with migrations in ORM-CLI
        • Implementation of a pattern command for migration
    • QueryBuilder
    • Caching
    • File structure
  • API
    • Decorators
      • Column
      • ComputedColumn
      • Index
      • ForeignKey
      • PrimaryGeneratedColumn
      • Relations
      • Table
      • Trigger
      • Types decorators
        • Integer
        • Numeric
        • Float
        • Boolean
        • String
    • DDL
    • QueryBuilder
    • Additional API
Powered by GitBook
On this page
  1. API
  2. Decorators

Relations

ManyToMany Decorator

The ManyToMany decorator is used to set up "many-to-many" relationships between tables.

Parameters of ManyToManyDecoratorInterface

  • foreignKey:

    • Type: string

    • Description: The name of the column that is the foreign key in the "many-to-many" relationship.

  • referencedColumn:

    • Type: string

    • Description: The name of the column that the foreign key refers to.

OneToMany Decorator

The OneToMany decorator is used to set up "one-to-many" relationships between tables.

Parameters of OneToManyDecoratorInterface

  • referenceColumn:

    • Type: string

    • Description: The name of the column that refers to the foreign key in the "one-to-many" relationship.

  • foreignKey:

    • Type: string

    • Description: The name of the column that is the foreign key in the "one-to-many" relationship.

OneToOne Decorator

The OneToOne decorator is used to set up "one-to-one" relationships between tables.

Parameters of OneToOneDecoratorInterface

  • table:

    • Type: string

    • Description: The name of the table to which the foreign key belongs in the "one-to-one" relationship.

  • foreignKey:

    • Type: string

    • Description: The name of the column that is the foreign key in the "one-to-one" relationship.

  • referenceColumn:

    • Type: string

    • Description: The name of the column that the foreign key refers to.

PreviousPrimaryGeneratedColumnNextTable

Last updated 9 months ago