* @param cascade cascade type used to perform this operation, depend if this method is called from a {@link #create(Object)} or an {@link #update(Object)}
* @param objectsBeingAccessed cache of objects being accessed during that write
*/
private <DataType> void updateProperties(AbstractBluePrintsBackedFinderService<? extends Graph, DataType, ?> service, Graph database, Object toUpdate, Vertex objectVertex, Map<Property, Collection<CascadeType>> containedProperties, CascadeType cascade, Map<String, Object> objectsBeingAccessed) {
for(Map.Entry<Property, Collection<CascadeType>> entry : containedProperties.entrySet()) {
Property p = entry.getKey();
// Static properties are by design not written
if(!p.hasModifier(Modifier.STATIC) && !Annotations.TRANSIENT.is(p)) {
Class<?> rawPropertyType = p.getType();
if(Collection.class.isAssignableFrom(rawPropertyType)) {
if (logger.isLoggable(Level.FINEST)) {
logger.log(Level.FINEST, "property "+p.getName()+" is considered a collection one");
}
updateCollection(service, database, p, toUpdate, objectVertex, cascade, objectsBeingAccessed);
// each value should be written as an independant value
} else if(Map.class.isAssignableFrom(rawPropertyType)) {
if (logger.isLoggable(Level.FINEST)) {
logger.log(Level.FINEST, "property "+p.getName()+" is considered a map one");
}
updateMap(service, database, p, toUpdate, objectVertex, cascade, objectsBeingAccessed);
} else {
updateSingle(service, database, p, toUpdate, objectVertex, cascade, objectsBeingAccessed);
}