diff --git a/lib/paris.ts b/lib/paris.ts index 851049a..0da808e 100644 --- a/lib/paris.ts +++ b/lib/paris.ts @@ -106,10 +106,9 @@ export class Paris { getRelationshipRepository(relationshipConstructor:Function):RelationshipRepository{ const relationship:EntityRelationshipRepositoryType = >relationshipConstructor; - let sourceEntityName:string = relationship.sourceEntityType.singularName.replace(/\s/g, ""), - dataEntityName:string = relationship.dataEntityType.singularName.replace(/\s/g, ""); - - let relationshipId:string = `${sourceEntityName}_${dataEntityName}`; + const sourceEntityName:string = relationship.sourceEntityType.name, + dataEntityName:string = relationship.dataEntityType.name, + relationshipId:string = `${sourceEntityName}_${dataEntityName}`; let repository:RelationshipRepository = >this.relationshipRepositories.get(relationshipId); if (!repository) {