pass only changes for logging datatables updates

This commit is contained in:
John Woodlock
2013-01-04 16:26:25 +00:00
parent b61ab594e4
commit 6177e41e70
4 changed files with 832 additions and 663 deletions
@@ -1,5 +1,7 @@
package org.mifosplatform.infrastructure.dataqueries.handler; package org.mifosplatform.infrastructure.dataqueries.handler;
import java.util.Map;
import org.mifosplatform.commands.handler.NewCommandSourceHandler; import org.mifosplatform.commands.handler.NewCommandSourceHandler;
import org.mifosplatform.infrastructure.core.api.JsonCommand; import org.mifosplatform.infrastructure.core.api.JsonCommand;
import org.mifosplatform.infrastructure.core.data.EntityIdentifier; import org.mifosplatform.infrastructure.core.data.EntityIdentifier;
@@ -24,9 +26,9 @@ public class UpdateOneToManyDatatableEntryCommandHandler implements
@Override @Override
public EntityIdentifier processCommand(final JsonCommand command) { public EntityIdentifier processCommand(final JsonCommand command) {
this.writePlatformService.updateDatatableEntryOneToMany(command.entityName(), command.resourceId(), command.subResourceId(), command); Map<String, Object> changes = this.writePlatformService.updateDatatableEntryOneToMany(command.entityName(), command.resourceId(), command.subResourceId(), command);
return EntityIdentifier.subResourceResult(command.resourceId(), command.subResourceId(), return EntityIdentifier.subResourceResult(command.resourceId(), command.subResourceId(),
command.commandId()); command.commandId(), changes);
} }
} }
@@ -24,7 +24,6 @@ public class UpdateOneToOneDatatableEntryCommandHandler implements NewCommandSou
@Override @Override
public EntityIdentifier processCommand(final JsonCommand command) { public EntityIdentifier processCommand(final JsonCommand command) {
// TODO - return only detected changes
Map<String, Object> changes = this.writePlatformService.updateDatatableEntryOneToOne(command.entityName(), command.resourceId(), command); Map<String, Object> changes = this.writePlatformService.updateDatatableEntryOneToOne(command.entityName(), command.resourceId(), command);
return EntityIdentifier.resourceResult(command.resourceId(), command.commandId(), changes); return EntityIdentifier.resourceResult(command.resourceId(), command.commandId(), changes);
@@ -24,7 +24,7 @@ public interface ReadWriteNonCoreDataService {
Map<String, Object> updateDatatableEntryOneToOne(String datatable, Long appTableId, JsonCommand command); Map<String, Object> updateDatatableEntryOneToOne(String datatable, Long appTableId, JsonCommand command);
void updateDatatableEntryOneToMany(String datatable, Long appTableId, Long datatableId, JsonCommand command); Map<String, Object> updateDatatableEntryOneToMany(String datatable, Long appTableId, Long datatableId, JsonCommand command);
void deleteDatatableEntries(String datatable, Long appTableId); void deleteDatatableEntries(String datatable, Long appTableId);