```
diff --git a/Doctrine/Phpcr/RouteProvider.php b/Doctrine/Phpcr/RouteProvider.php
index 5a26766..6a62bce 100644
--- a/Doctrine/Phpcr/RouteProvider.php
+++ b/Doctrine/Phpcr/RouteProvider.php
@@ -12,6 +12,7 @@
 
 namespace Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Phpcr;
 
+use PHPCR\Query\QueryInterface;
 use PHPCR\RepositoryException;
 
 use Symfony\Component\Routing\Route as SymfonyRoute;
@@ -135,11 +136,35 @@ class RouteProvider extends DoctrineProvider implements RouteProviderInterface
         return $route;
     }
 
+    protected function getRouteNames()
+    {
+        $dm = $this->getObjectManager();
+        $sql2 = 'SELECT * FROM [nt:unstructured] WHERE [phpcr:classparents] = '.$dm->quote('Symfony\Component\Routing\Route');
+
+        if ('' !== $this->idPrefix) {
+            $sql2.= ' AND ISDESCENDANTNODE('.$dm->quote($this->idPrefix).')';
+        }
+
+        $query = $dm->createPhpcrQuery($sql2, QueryInterface::JCR_SQL2);
+        $result = $query->execute();
+
+        $names = array();
+        foreach ($result as $row) {
+            $names[] = $row->getPath();
+        }
+
+        return $names;
+    }
+
     /**
      * {@inheritDoc}
      */
-    public function getRoutesByNames($names, $parameters = array())
+    public function getRoutesByNames($names = null, $parameters = array())
     {
+        if (null === $names) {
+            $names = $this->getRouteNames();
+        }
+
         if ('' !== $this->idPrefix) {
             foreach ($names as $key => $name) {
                 if (0 !== strpos($name, $this->idPrefix)) {
@@ -158,5 +183,4 @@ class RouteProvider extends DoctrineProvider implements RouteProviderInterface
 
         return $collection;
     }
-
 }
```