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
However turning logging on shown that NULL values are being inserted by the manager. It seems manager absolutely ignores the given values in case of setting such foreign keys (decorated with @RelationId).
For those looking for a solution here's a working example -
letproduct=newProduct();product.category={id: 1};// or new Category().id = 1 or assigned via constructorproduct.storageUrl=req.body.storageUrl;letresult=awaitthis.repository.persist(product);
Issue type:
[ ] question
[x] bug report
[ ] feature request
[ ] documentation issue
Database system/driver:
[ ]
cordova
[ ]
mongodb
[ ]
mssql
[ ]
mysql
/mariadb
[ ]
oracle
[ ]
postgres
[ ]
cockroachdb
[x]
sqlite
[ ]
sqljs
[ ]
react-native
[ ]
expo
TypeORM version:
[x]
latest
[ ]
@next
[x]
0.2.15
(or put your version here)Steps to reproduce or a small repository showing the problem:
I'm trying to insert an enity with entity manager by setting foreign relation ids instead of specify the related object directly, like:
However turning logging on shown that NULL values are being inserted by the manager. It seems manager absolutely ignores the given values in case of setting such foreign keys (decorated with @RelationId).
My entity:
Using legacy relation passing is fine:
The text was updated successfully, but these errors were encountered: