Search in sources :

Example 1 with EntitySignature

use of com.qcadoo.model.internal.utils.EntitySignature in project qcadoo by qcadoo.

the class DataAccessServiceImpl method performCascadeDelete.

private EntityOpResult performCascadeDelete(final InternalDataDefinition childDataDefinition, final Collection<Entity> children, final boolean testOnly, final Set<EntitySignature> traversedEntities) {
    for (Entity child : children) {
        EntitySignature childSignature = EntitySignature.of(child);
        if (!traversedEntities.contains(childSignature)) {
            traversedEntities.add(childSignature);
            EntityOpResult result = deleteEntity(childDataDefinition, child.getId(), testOnly, traversedEntities);
            if (!result.isSuccessfull()) {
                return result;
            }
        }
    }
    return EntityOpResult.successfull();
}
Also used : Entity(com.qcadoo.model.api.Entity) EntitySignature(com.qcadoo.model.internal.utils.EntitySignature) EntityOpResult(com.qcadoo.model.api.EntityOpResult)

Aggregations

Entity (com.qcadoo.model.api.Entity)1 EntityOpResult (com.qcadoo.model.api.EntityOpResult)1 EntitySignature (com.qcadoo.model.internal.utils.EntitySignature)1