diff --git a/lib/Doctrine/ORM/Tools/EntityGenerator.php b/lib/Doctrine/ORM/Tools/EntityGenerator.php
index 3e20ee5f7..905de215b 100644
--- a/lib/Doctrine/ORM/Tools/EntityGenerator.php
+++ b/lib/Doctrine/ORM/Tools/EntityGenerator.php
@@ -1045,6 +1045,10 @@ public function __construct()
                 if ($associationMapping['isCascadeMerge']) $cascades[] = '"merge"';
                 if ($associationMapping['isCascadeRefresh']) $cascades[] = '"refresh"';
 
+                if (count($cascades) === 5) {
+                    $cascades = array('"all"');
+                }
+
                 $typeOptions[] = 'cascade={' . implode(',', $cascades) . '}';
             }
 
diff --git a/lib/Doctrine/ORM/Tools/Export/Driver/PhpExporter.php b/lib/Doctrine/ORM/Tools/Export/Driver/PhpExporter.php
index 24f72431e..d2c26d7ee 100644
--- a/lib/Doctrine/ORM/Tools/Export/Driver/PhpExporter.php
+++ b/lib/Doctrine/ORM/Tools/Export/Driver/PhpExporter.php
@@ -99,6 +99,11 @@ class PhpExporter extends AbstractExporter
                     unset($cascade[$key]);
                 }
             }
+
+            if (count($cascade) === 5) {
+                $cascade = array('all');
+            }
+
             $associationMappingArray = array(
                 'fieldName'    => $associationMapping['fieldName'],
                 'targetEntity' => $associationMapping['targetEntity'],