private void deleteMap(AbstractBluePrintsBackedFinderService<? extends Graph, ?, ?> service, Graph database, Property p, Object toDelete, Vertex objectVertex, Collection<CascadeType> toCascade, Map<String, Object> objectsBeingAccessed) {
Iterable<Edge> edges = service.getStrategy().getOutEdgesFor(objectVertex, p);
Map<?, ?> values = (Map<?, ?>) p.get(toDelete);
Map<Vertex, Edge> oldVertices = new HashMap<Vertex, Edge>();
for (Edge e : edges) {
Vertex inVertex = e.getInVertex();
oldVertices.put(inVertex, e);
}
for (Object v : values.entrySet()) {
Vertex valueVertex = service.getVertexFor(v, CascadeType.REFRESH, objectsBeingAccessed);
if (oldVertices.containsKey(valueVertex)) {
Edge oldEdge = oldVertices.remove(valueVertex);
database.removeEdge(oldEdge);
if (toCascade.contains(CascadeType.REMOVE)) {
service.deleteOutEdgeVertex(objectVertex, valueVertex, v, objectsBeingAccessed);