When new version is made keep all it's contributors
This commit is contained in:
parent
1c22ed2321
commit
d603fed61f
|
@ -632,6 +632,16 @@ public class DataManagementPlanManager {
|
|||
|
||||
copyDatasets(newDmp, databaseRepository.getDatasetDao());
|
||||
|
||||
databaseRepository
|
||||
.getUserDmpDao().asQueryable().where((builder, root) -> builder.equal(root.get("dmp").get("id"), oldDmp.getId()))
|
||||
.toList().stream().forEach(userDMP -> {
|
||||
UserDMP temp = new UserDMP();
|
||||
temp.setUser(userDMP.getUser());
|
||||
temp.setRole(userDMP.getRole());
|
||||
temp.setDmp(newDmp);
|
||||
apiContext.getOperationsContext().getDatabaseRepository().getUserDmpDao().createOrUpdate(temp);
|
||||
});
|
||||
|
||||
newDmp.setUsers(new HashSet<>(databaseRepository.getUserDmpDao().asQueryable().where((builder, root) -> builder.equal(root.get("dmp").get("id"), newDmp.getId())).toList()));
|
||||
|
||||
DatasetCriteria criteria1 = new DatasetCriteria();
|
||||
|
|
Loading…
Reference in New Issue