You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
entity: person
items:
person{1..1000}:
personId: '{{random.uuid}}'
meetingId: '@meeting*'
The 'issue' is the following. When 'building' the relation meetingId: '@meeting*' the library retrieves from the database the full random meeting which contains the 'createdAt' field with of value of type 'LocalDateTime' created by the column 'LocalDateTimeTransformer'.
This field is then passed to 'class-transformer' who tries to instantiate the field (new LocalDate( LocalDate ) ) which obviously fails.
For now my fix consists of deleting all the LocalDate fields from the entity relation in 'preProcess()'.
My proposition would be not to load the full entity into the relation but instead only set the id of the target entity.
When the entity is saved typeorm is ignoring the data anyways and saves the id in the end.
The text was updated successfully, but these errors were encountered:
Firstly, thank you for the work on this library.
I am running into an issue similar to class-transformer decorators are ignored #87 in some way.
My setup is the following.
I am using special columns of typeorm like this in an entity I will call 'meeting'
I have another entity in relation with 'meeting' that I will call 'person' :
In my 'meeting.yml' file :
The 'issue' is the following. When 'building' the relation
meetingId: '@meeting*'
the library retrieves from the database the full random meeting which contains the 'createdAt' field with of value of type 'LocalDateTime' created by the column 'LocalDateTimeTransformer'.This field is then passed to 'class-transformer' who tries to instantiate the field (new LocalDate( LocalDate ) ) which obviously fails.
For now my fix consists of deleting all the LocalDate fields from the entity relation in 'preProcess()'.
My proposition would be not to load the full entity into the relation but instead only set the id of the target entity.
When the entity is saved typeorm is ignoring the data anyways and saves the id in the end.
The text was updated successfully, but these errors were encountered: