lakutata
Version:
An IoC-based universal application framework.
93 lines (84 loc) • 5.41 kB
TypeScript
import { JoinColumnOptions, JoinTableOptions, JoinTableMultipleColumnsOptions, RelationOptions } from './TypeDef.internal.68.js';
import { ObjectType } from './TypeDef.internal.36.js';
import './TypeDef.internal.30.js';
import { SelectQueryBuilder } from './TypeDef.internal.38.js';
/**
* JoinColumn decorator used on one-to-one relations to specify owner side of relationship.
* It also can be used on both one-to-one and many-to-one relations to specify custom column name
* or custom referenced column.
*/
declare function JoinColumn(): PropertyDecorator;
/**
* JoinColumn decorator used on one-to-one relations to specify owner side of relationship.
* It also can be used on both one-to-one and many-to-one relations to specify custom column name
* or custom referenced column.
*/
declare function JoinColumn(options: JoinColumnOptions): PropertyDecorator;
/**
* JoinColumn decorator used on one-to-one relations to specify owner side of relationship.
* It also can be used on both one-to-one and many-to-one relations to specify custom column name
* or custom referenced column.
*/
declare function JoinColumn(options: JoinColumnOptions[]): PropertyDecorator;
/**
* JoinTable decorator is used in many-to-many relationship to specify owner side of relationship.
* Its also used to set a custom junction table's name, column names and referenced columns.
*/
declare function JoinTable(): PropertyDecorator;
/**
* JoinTable decorator is used in many-to-many relationship to specify owner side of relationship.
* Its also used to set a custom junction table's name, column names and referenced columns.
*/
declare function JoinTable(options: JoinTableOptions): PropertyDecorator;
/**
* JoinTable decorator is used in many-to-many relationship to specify owner side of relationship.
* Its also used to set a custom junction table's name, column names and referenced columns.
*/
declare function JoinTable(options: JoinTableMultipleColumnsOptions): PropertyDecorator;
/**
* Many-to-many is a type of relationship when Entity1 can have multiple instances of Entity2, and Entity2 can have
* multiple instances of Entity1. To achieve it, this type of relation creates a junction table, where it storage
* entity1 and entity2 ids. This is owner side of the relationship.
*/
declare function ManyToMany<T>(typeFunctionOrTarget: string | ((type?: any) => ObjectType<T>), options?: RelationOptions): PropertyDecorator;
/**
* Many-to-many is a type of relationship when Entity1 can have multiple instances of Entity2, and Entity2 can have
* multiple instances of Entity1. To achieve it, this type of relation creates a junction table, where it storage
* entity1 and entity2 ids. This is owner side of the relationship.
*/
declare function ManyToMany<T>(typeFunctionOrTarget: string | ((type?: any) => ObjectType<T>), inverseSide?: string | ((object: T) => any), options?: RelationOptions): PropertyDecorator;
/**
* A many-to-one relation allows creating the type of relation where Entity1 can have a single instance of Entity2, but
* Entity2 can have multiple instances of Entity1. Entity1 is the owner of the relationship, and stores the id of
* Entity2 on its side of the relation.
*/
declare function ManyToOne<T>(typeFunctionOrTarget: string | ((type?: any) => ObjectType<T>), options?: RelationOptions): PropertyDecorator;
/**
* A many-to-one relation allows creating the type of relation where Entity1 can have a single instance of Entity2, but
* Entity2 can have multiple instances of Entity1. Entity1 is the owner of the relationship, and stores the id of
* Entity2 on its side of the relation.
*/
declare function ManyToOne<T>(typeFunctionOrTarget: string | ((type?: any) => ObjectType<T>), inverseSide?: string | ((object: T) => any), options?: RelationOptions): PropertyDecorator;
/**
* A one-to-many relation allows creating the type of relation where Entity1 can have multiple instances of Entity2,
* but Entity2 has only one Entity1. Entity2 is the owner of the relationship, and stores the id of Entity1 on its
* side of the relation.
*/
declare function OneToMany<T>(typeFunctionOrTarget: string | ((type?: any) => ObjectType<T>), inverseSide: string | ((object: T) => any), options?: RelationOptions): PropertyDecorator;
/**
* One-to-one relation allows the creation of a direct relation between two entities. Entity1 has only one Entity2.
* Entity1 is the owner of the relationship, and stores Entity2 id on its own side.
*/
declare function OneToOne<T>(typeFunctionOrTarget: string | ((type?: any) => ObjectType<T>), options?: RelationOptions): PropertyDecorator;
/**
* One-to-one relation allows the creation of a direct relation between two entities. Entity1 has only one Entity2.
* Entity1 is the owner of the relationship, and stores Entity2 id on its own side.
*/
declare function OneToOne<T>(typeFunctionOrTarget: string | ((type?: any) => ObjectType<T>), inverseSide?: string | ((object: T) => any), options?: RelationOptions): PropertyDecorator;
/**
* Special decorator used to extract relation id into separate entity property.
*
* @experimental
*/
declare function RelationId<T>(relation: string | ((object: T) => any), alias?: string, queryBuilderFactory?: (qb: SelectQueryBuilder<any>) => SelectQueryBuilder<any>): PropertyDecorator;
export { JoinColumn, JoinTable, ManyToMany, ManyToOne, OneToMany, OneToOne, RelationId };