All Downloads are FREE. Search and download functionalities are using the official Maven repository.

br.com.andrewribeiro.ribrest.services.command.MergeModelToPersistedModelCommand Maven / Gradle / Ivy

Go to download

Ribrest Framework - A simple Java framework that truly improve your productivity when developing restful based webservices.

There is a newer version: 1.27.0
Show newest version
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);
        
    }
    
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy