Class ModelRelationshipFacade
source · [−]Constructors
sourceconstructor
 
constructor
sourcenew <T>(_modelClass: ModelClass<T>): ModelRelationshipFacade<T>
 
new <T>(_modelClass: ModelClass<T>): ModelRelationshipFacade<T>
Properties
source_relationshipModel
 
_relationshipModel
source_relationship
 
_relationship
Accessors
Methods
sourceadd
 
add
source(modelClass: string | ModelClass<T>, relationshipTypeEnum: RelationshipEnum, config?: IObjectionModelRelationshipAddConfig): ModelRelationshipFacade<T>
 
(modelClass: string | ModelClass<T>, relationshipTypeEnum: RelationshipEnum, config?: IObjectionModelRelationshipAddConfig): ModelRelationshipFacade<T>
Create a relationship and add it inside of the class, saving the relationship mapping model inside. It will be able to get from the getter. Return the same class for chaining pattern.
memberofModelRelationshipFacade
sourcebelongsToOne
 
belongsToOne
source(modelClass: string | ModelClass<T>, config?: IObjectionModelRelationshipAddConfig): ModelRelationshipFacade<T>
 
(modelClass: string | ModelClass<T>, config?: IObjectionModelRelationshipAddConfig): ModelRelationshipFacade<T>
Shortcut for RelationshipEnum.BelongsToOneRelation
memberofModelRelationshipFacade
sourcegeToField
 
geToField
source(modelClass: string | ModelClass<T>, relation: RelationshipEnum): string
 
(modelClass: string | ModelClass<T>, relation: RelationshipEnum): string
Return the field name of "to" prop of "join" section
memberofModelRelationshipFacade
sourcegetFromField
 
getFromField
source(modelClass: string | ModelClass<T>, relation: RelationshipEnum): string
 
(modelClass: string | ModelClass<T>, relation: RelationshipEnum): string
Return the field name of "from" prop of "join" section
memberofModelRelationshipFacade
sourcegetRelationshipName
 
getRelationshipName
source(modelClass: string | ModelClass<T>, relation: RelationshipEnum): string
 
(modelClass: string | ModelClass<T>, relation: RelationshipEnum): string
Return the name of the relationship between the origin model to the end model. This is created based on the relationship between them.
memberofModelRelationshipFacade
sourcegetRelationshipType
 
getRelationshipType
source(relationshipEnum: RelationshipEnum): RelationType
 
(relationshipEnum: RelationshipEnum): RelationType
Return model RelationType based on the enum
memberofModelRelationshipFacade
sourcegetRelationships
 
getRelationships
source(opt?: IRelationshipDebugOptions<T>): IObjectionModelRelationship<T>
 
(opt?: IRelationshipDebugOptions<T>): IObjectionModelRelationship<T>
Return the relationship model created from adding relationship on "Add" method
memberofModelRelationshipFacade
sourcehasMany
 
hasMany
source(modelClass: string | ModelClass<T>, config?: IObjectionModelRelationshipAddConfig): ModelRelationshipFacade<T>
 
(modelClass: string | ModelClass<T>, config?: IObjectionModelRelationshipAddConfig): ModelRelationshipFacade<T>
Shortcut for RelationshipEnum.HasManyRelation
memberofModelRelationshipFacade
sourcehasOne
 
hasOne
source(modelClass: string | ModelClass<T>, config?: IObjectionModelRelationshipAddConfig): ModelRelationshipFacade<T>
 
(modelClass: string | ModelClass<T>, config?: IObjectionModelRelationshipAddConfig): ModelRelationshipFacade<T>
Shortcut for RelationshipEnum.HasOneRelation
memberofModelRelationshipFacade
sourcehasOneThrough
 
hasOneThrough
source(modelClass: string | ModelClass<T>, config?: IObjectionModelRelationshipAddConfig): ModelRelationshipFacade<T>
 
(modelClass: string | ModelClass<T>, config?: IObjectionModelRelationshipAddConfig): ModelRelationshipFacade<T>
Shortcut for RelationshipEnum.HasOneThroughRelation
memberofModelRelationshipFacade
sourcemanyToMany
 
manyToMany
source(modelClass: string | ModelClass<T>, config?: IObjectionModelRelationshipAddConfig): ModelRelationshipFacade<T>
 
(modelClass: string | ModelClass<T>, config?: IObjectionModelRelationshipAddConfig): ModelRelationshipFacade<T>
Shortcut for RelationshipEnum.ManyToManyRelation
memberofModelRelationshipFacade