Project

General

Profile

« Previous | Next » 

Revision 35ee4164

Added by Patrick Plitzner over 4 years ago

ref #6932 Do not reset merge candidates when saving before merge

View differences:

eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/e4/BulkEditorE4.java
143 143
            }
144 144
            @Override
145 145
            public boolean canModify(Object element, String property) {
146
                return true;
146
                return false;
147 147
            }
148 148
        });
149 149

  
......
190 190
	}
191 191

  
192 192
	@Override
193
    @Persist
193
	@Persist
194 194
	public void save(IProgressMonitor monitor) {
195
	    input.saveModel();
195
	    save(monitor, true);
196
	}
197

  
198
	public void save(IProgressMonitor monitor, boolean resetMerge) {
199
	    input.saveModel(resetMerge);
196 200

  
197 201
	    // commit the conversation and start a new transaction immediately
198 202
	    conversation.commit(true);
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/e4/handler/MergeGroupHandlerE4.java
52 52
            boolean proceed = MessageDialog.openQuestion(null,
53 53
                    "Save changes", "You have made changes that must be saved before this query can be executed. Would you like to proceed?");
54 54
            if (proceed) {
55
                editor.save(new NullProgressMonitor());
55
                editor.save(new NullProgressMonitor(), false);
56 56
            } else {
57 57
                return ;
58 58
            }
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/AbstractBulkEditorInput.java
179 179
	}
180 180

  
181 181
	public void saveModel(){
182
	    saveModel(true);
183
	}
184

  
185
	public void saveModel(boolean resetMerge){
182 186
	    //delete entities
183 187
	    for(Entry<T, DeleteConfiguratorBase> entry:toDelete.entrySet()){
184 188
	        try {
......
188 192
            }
189 193
	    }
190 194
	    toDelete.clear();
191
	    //merge entities
192
	    for(T mergeCandidate:mergeCandidates){
193
	        merge(mergeCandidate, mergeTarget);
195
	    if(resetMerge){
196
	        //merge entities
197
	        for(T mergeCandidate:mergeCandidates){
198
	            merge(mergeCandidate, mergeTarget);
199
	        }
200
	        mergeCandidates.clear();
201
	        mergeTarget = null;
194 202
	    }
195
	    mergeCandidates.clear();
196
	    mergeTarget = null;
197 203
	}
198 204

  
199 205

  

Also available in: Unified diff