ensure resource idenity is stored with a CREATE command source when command is processed by platform. Allows ability to see all state changing commands accepted to date by platform for a given resource.

This commit is contained in:
Keith Woodlock
2012-11-16 13:26:25 +00:00
parent e61454792f
commit ce188814ec
7 changed files with 542 additions and 405 deletions
@@ -86,6 +86,10 @@ public class CommandSource extends AbstractPersistable<Long> {
this.checkedOnDate = checkedOnDate.toDate();
}
public void updateResourceId(final Long resourceId) {
this.resourceId = resourceId;
}
public Long resourceId() {
return this.resourceId;
}
@@ -53,6 +53,7 @@ public class PortfolioCommandSourceWriteServiceImpl implements PortfolioCommandS
try {
resourceId = this.clientWritePlatformService.createClient(command);
entity.markAsChecked(maker, asToday);
entity.updateResourceId(resourceId);
} catch (RollbackTransactionAsCommandIsNotApprovedByCheckerException e) {
// swallow this rollback transaction by design
}
@@ -103,6 +104,8 @@ public class PortfolioCommandSourceWriteServiceImpl implements PortfolioCommandS
}
}
entity.updateResourceId(resourceId);
commandSourceRepository.save(entity);
return EntityIdentifier.makerChecker(resourceId, entity.getId());