forked from typeorm/typeorm
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMissingJoinTableError.ts
More file actions
22 lines (18 loc) · 909 Bytes
/
MissingJoinTableError.ts
File metadata and controls
22 lines (18 loc) · 909 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import {EntityMetadata} from "../metadata/EntityMetadata";
import {RelationMetadata} from "../metadata/RelationMetadata";
/**
*/
export class MissingJoinTableError extends Error {
name = "MissingJoinTableError";
constructor(entityMetadata: EntityMetadata, relation: RelationMetadata) {
super();
if (relation.inverseRelation) {
this.message = `JoinTable is missing on both sides of ${entityMetadata.name}#${relation.propertyName} and ` +
`${relation.inverseEntityMetadata.name}#${relation.inverseRelation.propertyName} many-to-many relationship. ` +
`You need to put decorator decorator on one of the sides.`;
} else {
this.message = `JoinTable is missing on ${entityMetadata.name}#${relation.propertyName} many-to-many relationship. ` +
`You need to put JoinTable decorator on it.`;
}
}
}