Fixed RelationId generation. (#192)

Fixed RelationId generation.
This commit is contained in:
Kononnable 2019-08-25 22:16:57 +02:00 committed by GitHub
commit 0bedb0da7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -33,10 +33,11 @@ import {BaseEntity,Column,Entity,Index,JoinColumn,JoinTable,ManyToMany,ManyToOne
{{/if}}
{{#if relationIdField }}
@RelationId(({{toPropertyName ../../tsEntityName}}: {{toEntityName ../../tsEntityName}}) => {{toEntityName ../../tsEntityName}}.{{toPropertyName ../tsName}})
@RelationId(({{toPropertyName ../../tsEntityName}}: {{toEntityName ../../tsEntityName}}) => {{toPropertyName ../../tsEntityName}}.{{toPropertyName ../tsName}})
{{printPropertyVisibility}}{{toPropertyName ../tsName}}Id{{strictMode}}: {{#if isOneToOne}}{{toLazy ../tsType}}{{else}}{{toLazy (concat ../tsType "[]")}}{{/if}};{{/if}}{{/relations}}
{{/Columns}}
{{#if GenerateConstructor}}
{{printPropertyVisibility}}constructor(init?: Partial<{{toEntityName tsEntityName}}>) {
{{#IsActiveRecord}}super();
{{/IsActiveRecord}}Object.assign(this, init);