eager relation load breaks foreign key update
See original GitHub issueWhen relation set to eager loading, update a foreign key will be failed.
partial entity
export class Book {
catId:number;
cat:Cat;
}
When update catId
it will load cat
to override the update.
cat
in found
and only catId
in dto
The result will be
{
"catId": "new value",
"cat": {"id":"old value"}
}
typeorm
will use object
instead of id
Issue Analytics
- State:
- Created 4 years ago
- Reactions:7
- Comments:13 (2 by maintainers)
Top Results From Across the Web
Eager loading not working with string foreign key - Stack ...
Long answer It seems you tried to configure a one-to-many relationship between Lots and Listings : Every Lot has zero or more Listings...
Read more >Eager loading not working on many to many relationship
Set up; I have a Programme model with a one to one relation to a User (belongsTo) many to many relation to a...
Read more >Eager and Lazy Relations - typeorm - GitBook
Eager relations are loaded automatically each time you load entities from the database. For example: import { Entity, PrimaryGeneratedColumn, Column, ...
Read more >Retrieving Data & Results Sets - 4.x - CakePHP Cookbook
contain define the associations to eager load. ... If the results are missing association entities, make sure the foreign key columns are selected...
Read more >Sessions / Queries - SQLAlchemy 1.4 Documentation
The answer is that “post_update” is used to break a cycle between two mutually dependent foreign keys, and to have this cycle breaking...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@alexmantaut thanks for the attention. you can see after the refactor this issue seems gone. you can try the
next
version or just waiting for the next release.btw, @zMotivat0r When is it released?
Hi all, I’m having the same issue, whether to wait for a fix?