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
I am trying to assign new dept to Employee using deptNameusing JsonPatch but the update to DB is not happening. I noticed that my patched object has Dept object has new/updated name but no is still pointing to old deptNo. Looks like Patch is attempting to update dept.deptName instead of updating reference to entire dept entity (which I think should be the case). what am i missing here?
@entity
public class EMP{ @manytoone(fetch = FetchType.LAZY) @joincolumn(name = "deptNo", referencedColumnName = "deptNo")
private Dept dept;
}
@entity
public class Dept {
private String deptName;
private Integer deptNo;
}
The text was updated successfully, but these errors were encountered:
prats2017
changed the title
Json Patch - Update nested an attribute in nested object
Json Patch - attempt to update attribute of an nested object is not happening.
Apr 8, 2020
I am trying to assign new dept to Employee using deptNameusing JsonPatch but the update to DB is not happening. I noticed that my patched object has Dept object has new/updated name but no is still pointing to old deptNo. Looks like Patch is attempting to update dept.deptName instead of updating reference to entire dept entity (which I think should be the case). what am i missing here?
[{"op":"replace", "path":"/dept/name","value":"HR"} ]
@entity
public class EMP{
@manytoone(fetch = FetchType.LAZY)
@joincolumn(name = "deptNo", referencedColumnName = "deptNo")
private Dept dept;
}
@entity
public class Dept {
private String deptName;
private Integer deptNo;
}
The text was updated successfully, but these errors were encountered: