/** * {@inheritDoc}<br/> * Clears the relationship to the input data model, output data model, mappings and functions. */ @Override protected void prepareObjectForRemoval(final Project object) { // should clear the relationship to the input data model, output data model, mappings and functions object.setInputDataModel(null); object.setOutputDataModel(null); object.setMappings(null); object.setSkipFilter(null); object.setFunctions(null); }
public Project createProject(final String name, final String description, final Set<Mapping> mappings, final DataModel inputDataModel, final DataModel outputDataModel, final Set<Function> functions) { final String uuid = UUIDService.getUUID(Project.class.getSimpleName()); final Project project = new Project(uuid); project.setName(name); project.setDescription(description); project.setMappings(mappings); project.setInputDataModel(inputDataModel); project.setOutputDataModel(outputDataModel); project.setFunctions(functions); return project; }
project.setName("my project"); project.setDescription("my description"); project.setMappings(mappings); project.setInputDataModel(inputDataModel); project.setOutputDataModel(outputDataModel);
/** * {@inheritDoc} */ @Override public void updateObjectInternal(final Project object, final Project updateObject) throws DMPPersistenceException { super.updateObjectInternal(object, updateObject); final DataModel inputDataModel = object.getInputDataModel(); final DataModel outputDataModel = object.getOutputDataModel(); final Set<Mapping> mappings = object.getMappings(); final Filter skipFilter = object.getSkipFilter(); final Set<Function> functions = object.getFunctions(); final Set<String> selectedRecords = object.getSelectedRecords(); updateObject.setInputDataModel(inputDataModel); updateObject.setOutputDataModel(outputDataModel); updateObject.setMappings(mappings); updateObject.setSkipFilter(skipFilter); updateObject.setFunctions(functions); updateObject.setSelectedRecords(selectedRecords); }
/** * {@inheritDoc}<br/> * Updates the name, description, (sample) input data model, output data model, mappings and functions of the project. */ @Override protected Project prepareObjectForUpdate(final Project objectWithUpdates, final Project object) { super.prepareObjectForUpdate(objectWithUpdates, object); object.setFunctions(objectWithUpdates.getFunctions()); object.setInputDataModel(objectWithUpdates.getInputDataModel()); object.setOutputDataModel(objectWithUpdates.getOutputDataModel()); object.setSkipFilter(objectWithUpdates.getSkipFilter()); object.setMappings(objectWithUpdates.getMappings()); object.setSelectedRecords(objectWithUpdates.getSelectedRecords()); return object; }