// Path: src/main/java/de/fhg/igd/mongomvcc/VException.java
// public class VException extends RuntimeException {
// 	private static final long serialVersionUID = 4131582095330835424L;
// 
// 	/**
// 	 * @see RuntimeException#RuntimeException()
// 	 */
// 	public VException() {
// 		super();
// 	}
// 	
// 	/**
// 	 * @see RuntimeException#RuntimeException(String)
// 	 */
// 	public VException(String message) {
// 		super(message);
// 	}
// 	
// 	/**
// 	 * @see RuntimeException#RuntimeException(Throwable)
// 	 */
// 	public VException(Throwable cause) {
// 		super(cause);
// 	}
// 	
// 	/**
// 	 * @see RuntimeException#RuntimeException(String, Throwable)
// 	 */
// 	public VException(String message, Throwable cause) {
// 		super(message, cause);
// 	}
// }


import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import de.fhg.igd.mongomvcc.VException;
		for (Map.Entry<String, Object> e : obj.entrySet()) {
			Object v = e.getValue();
			long oid = _convert.convert(v);
			if (oid != 0) {
				e.setValue(oid);
				binaryAttributes.add(e.getKey());
			}
		}
		
		//save which attributes point to GridFS files
		if (!binaryAttributes.isEmpty()) {
			obj.put(BINARY_ATTRIBUTES, binaryAttributes);
		}
	}
	
	@Override
	public void onResolve(Map<String, Object> obj) {
		@SuppressWarnings("unchecked")
		List<String> binaryAttributes = (List<String>)obj.get(BINARY_ATTRIBUTES);
		if (binaryAttributes == null) {
			//nothing to do
			return;
		}
		
		try {
			for (String attr : binaryAttributes) {
				long gridId = (Long)obj.get(attr);
				obj.put(attr, _convert.convert(gridId));
			}
		} catch (IOException e) {
// Path: src/main/java/de/fhg/igd/mongomvcc/VException.java
// public class VException extends RuntimeException {
// 	private static final long serialVersionUID = 4131582095330835424L;
// 
// 	/**
// 	 * @see RuntimeException#RuntimeException()
// 	 */
// 	public VException() {
// 		super();
// 	}
// 	
// 	/**
// 	 * @see RuntimeException#RuntimeException(String)
// 	 */
// 	public VException(String message) {
// 		super(message);
// 	}
// 	
// 	/**
// 	 * @see RuntimeException#RuntimeException(Throwable)
// 	 */
// 	public VException(Throwable cause) {
// 		super(cause);
// 	}
// 	
// 	/**
// 	 * @see RuntimeException#RuntimeException(String, Throwable)
// 	 */
// 	public VException(String message, Throwable cause) {
// 		super(message, cause);
// 	}
// }


// Path: src/main/java/de/fhg/igd/mongomvcc/impl/DefaultAccessStrategy.java
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import de.fhg.igd.mongomvcc.VException;

		for (Map.Entry<String, Object> e : obj.entrySet()) {
			Object v = e.getValue();
			long oid = _convert.convert(v);
			if (oid != 0) {
				e.setValue(oid);
				binaryAttributes.add(e.getKey());
			}
		}
		
		//save which attributes point to GridFS files
		if (!binaryAttributes.isEmpty()) {
			obj.put(BINARY_ATTRIBUTES, binaryAttributes);
		}
	}
	
	@Override
	public void onResolve(Map<String, Object> obj) {
		@SuppressWarnings("unchecked")
		List<String> binaryAttributes = (List<String>)obj.get(BINARY_ATTRIBUTES);
		if (binaryAttributes == null) {
			//nothing to do
			return;
		}
		
		try {
			for (String attr : binaryAttributes) {
				long gridId = (Long)obj.get(attr);
				obj.put(attr, _convert.convert(gridId));
			}
		} catch (IOException e) {
			throw new VException("Could not read binary data", e);