br.com.andrewribeiro.ribrest.services.command.MergeModelToPersistedModelCommand Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of Ribrest Show documentation
Show all versions of Ribrest Show documentation
Ribrest Framework - A simple Java framework that truly improve your productivity when developing restful based webservices.
package br.com.andrewribeiro.ribrest.services.command;
import br.com.andrewribeiro.ribrest.exceptions.RibrestDefaultException;
import br.com.andrewribeiro.ribrest.model.interfaces.Model;
/**
*
* @author Andrew Ribeiro
*/
public class MergeModelToPersistedModelCommand extends AbstractCommand{
@Override
public void execute() throws RibrestDefaultException, Exception {
Model model = flowContainer.getModel();
Model persistedModel = (Model) flowContainer.getExtraObject(Model.PERSISTED_MODEL_KEY);
flowContainer.removeExtraObject(Model.PERSISTED_MODEL_KEY);
persistedModel.merge(model);
flowContainer.setModel(persistedModel);
}
}