Closed 123445666 closed 2 years ago
Yes i think is good, @ivanmonteiro are you also agree ? @123445666 What do you pass in parameter entitiesToBeUpdated ?
@nicolas63 With the new AddOrUpdateGraph, it'll only update the root Entity (without the child) except "many-to-many relation"
If there are "many-to-many", it'll pass the name of child entity like this
List<string> entitiesToBeUpdated = new List<string> { "PieceOfWork" };
return await base.CreateOrUpdateAsync(job, entitiesToBeUpdated);
Maybe it's better to pass a type like
List
Are you ok with this ?
It's ok, i'll do it that way.
Yes i think is good, @ivanmonteiro are you also agree ? @123445666 What do you pass in parameter entitiesToBeUpdated ?
I agree, for the moment we can try @123445666's approach.
Hi @nicolas63 ,
Overview of the issue
When working with Dao issue, i found a bug related many-to-many relationship with ef.
Motivation for or Use Case
Create or edit a Job History and Save. It shows : 'UNIQUE constraint failed: JobChores.ChoresId, JobChores.JobsId'."
Reproduce the error
I used the app.jdl in the test folder but commented the dto line.
Related issues
Suggest a Fix
My solution is: I'll change this function AddOrUpdateGraph like below.
Do you think it's ok ? If ok, i'll make the pull request. Thank you.
JHipster Version(s)
JHipster configuration
Entity configuration(s)
entityName.json
files generated in the.jhipster
directoryBrowsers and Operating System