import { Injectable } from '@nestjs/common'; import { InjectRepository } from '@nestjs/typeorm'; import { EntityRelation } from '../entity/entity-relation.entity'; import { Repository } from 'typeorm'; @Injectable() export class EntityRelationRepository { constructor( @InjectRepository(EntityRelation) private readonly entityRelationRepository: Repository, ) { } async findBySourceEntityTypeAndTargetEntityType(source_entity_type:string, target_entity_type:string) { return await this.entityRelationRepository.findOne({ where: { source_entity_type, target_entity_type } }) } }