Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.nakedobjects.plugins.xml.objectstore.internal.commands;
 
public final class XmlUpdateObjectCommand 
		implements SaveObjectCommand {
	private static final Logger LOG = Logger.getLogger(XmlDestroyObjectCommand.class);
	public XmlUpdateObjectCommand(final NakedObject adapterfinal DataManager dataManager) {
		super(adapterdataManager);
	}
	public void execute(final NakedObjectTransaction contextthrows ObjectPersistenceException {
		if (.isDebugEnabled()) {
			.debug("  save object " + onObject());
		}
	    final String user = getAuthenticationSession().getUserName();
	    onObject().setOptimisticLock(new FileVersion(user));
	    final Data data = createObjectData(onObject(), true);
	    getDataManager().save(data);
	}
	public String toString() {
	    return "SaveObjectCommand [object=" + onObject() + "]";
	}
New to GrepCode? Check out our FAQ X