Google Groups Home
Help | Sign in
r4365 - in branches/experimental/jepso-dq l-parser-rewrite: lib/Doctrine lib/Doctrine/Query/Production tests/Orm/Query
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  1 message - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
no-re...@phpdoctrine.org  
View profile
 More options 16 May, 20:09
From: no-re...@phpdoctrine.org
Date: Fri, 16 May 2008 20:09:50 +0100
Local: Fri 16 May 2008 20:09
Subject: r4365 - in branches/experimental/jepso-dql-parser-r ewrite: lib/Doctrine lib/Doctrine/Query/Production tests/Orm/Query
Author: guilhermeblanco
Date: 2008-05-16 20:09:48 +0100 (Fri, 16 May 2008)
New Revision: 4365

Modified:
   branches/experimental/jepso-dql-parser-rewrite/lib/Doctrine/Query.php
   branches/experimental/jepso-dql-parser-rewrite/lib/Doctrine/Query/Productio n/IdentificationVariableDeclaration.php
   branches/experimental/jepso-dql-parser-rewrite/lib/Doctrine/Query/Productio n/IndexBy.php
   branches/experimental/jepso-dql-parser-rewrite/lib/Doctrine/Query/Productio n/PathExpression.php
   branches/experimental/jepso-dql-parser-rewrite/lib/Doctrine/Query/Productio n/PathExpressionEndingWithAsterisk.php
   branches/experimental/jepso-dql-parser-rewrite/lib/Doctrine/Query/Productio n/RangeVariableDeclaration.php
   branches/experimental/jepso-dql-parser-rewrite/lib/Doctrine/Query/Productio n/SelectExpression.php
   branches/experimental/jepso-dql-parser-rewrite/tests/Orm/Query/AllTests.php
   branches/experimental/jepso-dql-parser-rewrite/tests/Orm/Query/IdentifierRe cognitionTest.php
   branches/experimental/jepso-dql-parser-rewrite/tests/Orm/Query/LanguageReco gnitionTest.php
Log:
Intermediate commit with enhancements to new DQL parser. Ported missing tests, most of them failing yet. Working on language recognition finalization. When ended, back to SQL generation

Modified: branches/experimental/jepso-dql-parser-rewrite/lib/Doctrine/Query/Productio n/IdentificationVariableDeclaration.php
===================================================================
--- branches/experimental/jepso-dql-parser-rewrite/lib/Doctrine/Query/Productio n/IdentificationVariableDeclaration.php 2008-05-13 21:20:34 UTC (rev 4364)
+++ branches/experimental/jepso-dql-parser-rewrite/lib/Doctrine/Query/Productio n/IdentificationVariableDeclaration.php 2008-05-16 19:09:48 UTC (rev 4365)
@@ -35,23 +35,31 @@
 {
     public function syntax($paramHolder)
     {
-        $queryObject = $this->_parser->getQueryObject();
-
         $alias = $this->RangeVariableDeclaration($paramHolder);

         if ($this->_isNextToken(Doctrine_Query_Token::T_INDEX)) {
-            $this->IndexBy(array('alias' => $alias));
+            $paramHolder->set('alias', $alias);
+            $this->IndexBy($paramHolder);
+            $paramHolder->remove('alias');
         }

         while ($this->_isNextToken(Doctrine_Query_Token::T_LEFT) ||
                $this->_isNextToken(Doctrine_Query_Token::T_INNER) ||
                $this->_isNextToken(Doctrine_Query_Token::T_JOIN)) {

-            $this->Join();
+            $this->Join($paramHolder);

             if ($this->_isNextToken(Doctrine_Query_Token::T_INDEX)) {
-                $this->IndexBy(array('alias' => $alias));
+                $paramHolder->set('alias', $alias);
+                $this->IndexBy($paramHolder);
+                $paramHolder->remove('alias');
             }
         }
     }
+
+
+    public function buildSql()
+    {
+        return '';
+    }
 }

Modified: branches/experimental/jepso-dql-parser-rewrite/lib/Doctrine/Query/Productio n/IndexBy.php
===================================================================
--- branches/experimental/jepso-dql-parser-rewrite/lib/Doctrine/Query/Productio n/IndexBy.php   2008-05-13 21:20:34 UTC (rev 4364)
+++ branches/experimental/jepso-dql-parser-rewrite/lib/Doctrine/Query/Productio n/IndexBy.php   2008-05-16 19:09:48 UTC (rev 4365)
@@ -32,10 +32,24 @@
  */
 class Doctrine_Query_Production_IndexBy extends Doctrine_Query_Production
 {
+    public function syntax($paramHolder)
+    {
+        $this->_parser->match(Doctrine_Query_Token::T_INDEX);
+        $this->_parser->match(Doctrine_Query_Token::T_BY);
+        $this->_parser->match(Doctrine_Query_Token::T_IDENTIFIER);
+
+        $this->_processIndexBy($paramHolder['alias'], $this->_parser->token['value']);
+    }
+
+
+    public function buildSql()
+    {}
+
+
     private function _processIndexBy($alias, $column)
     {
-        $queryObject = $this->_parser->getQueryObject();
-        $queryComponent = $queryObject->getQueryComponent($alias);
+        $parserResult = $this->_parser->getParserResult();
+        $queryComponent = $parserResult->getQueryComponent($alias);
         $metadata = $queryComponent['metadata'];

         if ($metadata instanceof Doctrine_ClassMetadata && ! $metadata->hasField($column)) {
@@ -46,15 +60,6 @@
         }

         $queryComponent['map'] = $column;
-        $queryObject->setQueryComponent($alias, $queryComponent);
+        $parserResult->setQueryComponent($alias, $queryComponent);
     }
-
-    public function execute(array $params = array())
-    {
-        $this->_parser->match(Doctrine_Query_Token::T_INDEX);
-        $this->_parser->match(Doctrine_Query_Token::T_BY);
-        $this->_parser->match(Doctrine_Query_Token::T_IDENTIFIER);
-
-        $this->_processIndexBy($params['alias'], $this->_parser->token['value']);
-    }
 }

Modified: branches/experimental/jepso-dql-parser-rewrite/lib/Doctrine/Query/Productio n/PathExpression.php
===================================================================
--- branches/experimental/jepso-dql-parser-rewrite/lib/Doctrine/Query/Productio n/PathExpression.php    2008-05-13 21:20:34 UTC (rev 4364)
+++ branches/experimental/jepso-dql-parser-rewrite/lib/Doctrine/Query/Productio n/PathExpression.php    2008-05-16 19:09:48 UTC (rev 4365)
@@ -68,7 +68,7 @@
                     // Assigning new ClassMetadata
                     $classMetadata = $classMetadata->getRelation($relationName)->getClassMetadata();
                 } elseif ( $classMetadata === null ) {
-                    $queryComponent = $this->_parser->getParserResult()->getQueryComponent($relationName);
+                    $queryComponent = $parserResult->getQueryComponent($relationName);

                     // We should have a semantical error if the queryComponent does not exists yet
                     if ($queryComponent === null) {
@@ -85,7 +85,7 @@
                 if ($classMetadata === null) {
                     // No metadata selection until now. We might need to deal with:
                     // DELETE FROM Obj alias WHERE field = X
-                    $queryComponents = $this->_parser->getParserResult()->getQueryComponents();
+                    $queryComponents = $parserResult->getQueryComponents();

                     // Check if we have more than one queryComponent defined
                     if (count($queryComponents) > 1) {
@@ -133,9 +133,10 @@

         for ($i = 0, $l = count($this->_identifiers); $i < $l; $i++) {
             if ($i < $l - 1) {
-                // [TODO] We are assuming we never define relations in WHERE clauses.
-                // So, do not bother about table alias that may not be previously added.
-                // At a later stage, we should deal with it too.
+                // [TODO] We are assuming we never define relations in SELECT
+                // and WHERE clauses. So, do not bother about table alias that
+                // may not be previously added. At a later stage, we should
+                // deal with it too.
                 $str .= $parserResult->getTableAliasFromComponentAlias($this->_identifiers[$i]) . '.';
             } else {
                 // Retrieving last ClassMetadata

Modified: branches/experimental/jepso-dql-parser-rewrite/lib/Doctrine/Query/Productio n/PathExpressionEndingWithAsterisk.php
===================================================================
--- branches/experimental/jepso-dql-parser-rewrite/lib/Doctrine/Query/Productio n/PathExpressionEndingWithAsterisk.php  2008-05-13 21:20:34 UTC (rev 4364)
+++ branches/experimental/jepso-dql-parser-rewrite/lib/Doctrine/Query/Productio n/PathExpressionEndingWithAsterisk.php  2008-05-16 19:09:48 UTC (rev 4365)
@@ -32,13 +32,76 @@
  */
 class Doctrine_Query_Production_PathExpressionEndingWithAsterisk extends Doctrine_Query_Production
 {
-    public function execute(array $params = array())
+    protected $_identifiers = array();
+
+
+    public function syntax($paramHolder)
     {
+        // PathExpressionEndingWithAsterisk = {identifier "."} "*"
         while ($this->_isNextToken(Doctrine_Query_Token::T_IDENTIFIER)) {
+            $this->_identifiers[] = $this->_parser->token['value'];
+
             $this->_parser->match(Doctrine_Query_Token::T_IDENTIFIER);
             $this->_parser->match('.');
         }

         $this->_parser->match('*');
     }
+
+
+    public function semantical($paramHolder)
+    {
+        $parserResult = $this->_parser->getParserResult();
+
+        if (($l = count($this->_identifiers)) > 0) {
+            // We are working with relations here.
+            $queryComponent = $parserResult->getQueryComponent($this->_identifiers[0]);
+            $classMetadata = $queryComponent['metadata'];
+
+            for ($i = 1; $i < $l; $i++) {
+                $relationName = $this->_identifiers[$i];
+
+                // We are still checking for relations
+                if ( $classMetadata !== null && ! $classMetadata->hasRelation($relationName)) {
+                    $className = $classMetadata->getClassName();
+
+                    $this->_parser->semanticalError("Relation '{$relationName}' does not exist in component '{$className}'");
+
+                    // Assigning new ClassMetadata
+                    $classMetadata = $classMetadata->getRelation($relationName)->getClassMetadata();
+                } elseif ( $classMetadata === null ) {
+                    $queryComponent = $parserResult->getQueryComponent($relationName);
+
+                    // We should have a semantical error if the queryComponent does not exists yet
+                    if ($queryComponent === null) {
+                        $this->_parser->semanticalError("Undefined component alias for relation '{$relationName}'");
+                    }
+
+                    // Initializing ClassMetadata
+                    $classMetadata = $queryComponent['metadata'];
+                }
+            }
+        } else {
+            // We are dealing with a simple * as our PathExpression.
+            // We need to check if there's only one query component.
+            $queryComponents = $parserResult->getQueryComponents();
+
+            if (count($queryComponents) != 1) {
+                $this->_parser->semanticalError(
+                    "Cannot use * as selector expression for multiple components."
+                );
+            }
+
+            // We simplify our life adding the component alias to our AST,
+            // since we have it on hands now.
+            $k = array_keys($queryComponents);
+            $this->_identifiers[] = $k[0];
+        }
+    }
+
+
+    public function buildSql()
+    {
+        return '';
+    }
 }

Modified: branches/experimental/jepso-dql-parser-rewrite/lib/Doctrine/Query/Productio n/RangeVariableDeclaration.php
===================================================================
--- branches/experimental/jepso-dql-parser-rewrite/lib/Doctrine/Query/Productio n/RangeVariableDeclaration.php  2008-05-13 21:20:34 UTC (rev 4364)
+++ branches/experimental/jepso-dql-parser-rewrite/lib/Doctrine/Query/Productio n/RangeVariableDeclaration.php  2008-05-16 19:09:48 UTC (rev 4365)
@@ -33,8 +33,49 @@
  */
 class Doctrine_Query_Production_RangeVariableDeclaration extends Doctrine_Query_Production
 {
-    public function execute(array $params = array())
+    protected $_identifiers = array();
+
+    protected $_identificationVariable;
+
+
+    public function syntax($paramHolder)
     {
+        $this->_parser->match(Doctrine_Query_Token::T_IDENTIFIER);
+        $this->_identifiers[] = $this->_parser->token['value'];
+
+        while ($this->_isNextToken('.')) {
+            $this->_parser->match('.');
+            $this->_parser->match(Doctrine_Query_Token::T_IDENTIFIER);
+
+            $this->_identifiers[] = $this->_parser->token['value'];
+        }
+
+        if ($this->_isNextToken(Doctrine_Query_Token::T_AS)) {
+            $this->_parser->match(Doctrine_Query_Token::T_AS);
+        }
+
+        if ($this->_isNextToken(Doctrine_Query_Token::T_IDENTIFIER)) {
+            $paramHolder->set('componentName', implode('.', $this->_identifiers));
+
+            // Will return an identifier, with the semantical check already applied
+            $this->_identificationVariable = $this->IdentificationVariable($paramHolder);
+
+            $paramHolder->remove('componentName');
+        }
+    }
+
+
+    public function semantical($paramHolder)
+    {
+    }
+
+
+    public function buildSql()
+    {}
+
+
+    /*public function execute(array $params = array())
+    {
         // RangeVariableDeclaration = identifier {"." identifier} [["AS"] IdentificationVariable]
         $path = '';

@@ -123,5 +164,5 @@
         $parserResult->setQueryComponent($alias, $queryComponent);

         return $alias;
-    }
+    }*/
 }

Modified: branches/experimental/jepso-dql-parser-rewrite/lib/Doctrine/Query/Productio n/SelectExpression.php
===================================================================
--- branches/experimental/jepso-dql-parser-rewrite/lib/Doctrine/Query/Productio n/SelectExpression.php  2008-05-13 21:20:34 UTC (rev 4364)
+++ branches/experimental/jepso-dql-parser-rewrite/lib/Doctrine/Query/Productio n/SelectExpression.php  2008-05-16 19:09:48 UTC (rev 4365)
@@ -72,6 +72,13 @@
         // Here we inspect for duplicate IdentificationVariable, and if the
         // left expression needs the identification variable. If yes, check
         // its existance.
+       if ( $this->_leftExpression instanceof PathExpressionEndingWithAsterisk && $this->_identificationVariable !== null ) {
+               $this->_parser->semanticalError(
+                    "Cannot assign an identification variable to a path expression with asterisk."
+                );
+       }
+
+       // The check for duplicate IdentificationVariable was already done
     }

Modified: branches/experimental/jepso-dql-parser-rewrite/lib/Doctrine/Query.php
===================================================================
--- branches/experimental/jepso-dql-parser-rewrite/lib/Doctrine/Query.php       2008-05-13 21:20:34 UTC (rev 4364)
+++ branches/experimental/jepso-dql-parser-rewrite/lib/Doctrine/Query.php       2008-05-16 19:09:48 UTC (rev 4365)
@@ -220,26 +220,27 @@
      */
     public function getSql()
     {
-        $this->_parse();
-        return $this->_parserResult->getSqlExecutor()->getSqlStatements();
+        return $this->parse()->getSqlExecutor()->getSqlStatements();
     }
-    
+
+
     /**
      * Parses the DQL query, if necessary, and stores the parser result.
      *
      * @return Doctrine_Query_ParserResult
      */
-    private function _parse()
+    public function parse()
     {
         if ($this->_state === self::STATE_DIRTY) {
             $parser = new Doctrine_Query_Parser($this->getDql());
             $this->_parserResult = $parser->parse();
             $this->_state = self::STATE_CLEAN;
         }
-        
+
         return $this->_parserResult;
     }

+
     /**
      * Executes the query and populates the data set.
      *
@@ -323,7 +324,7 @@

             if ($cached === false) {
                 // Cache does not exist, we have to create it.
-                $executor = $this->_parse()->getSqlExecutor();
+                $executor = $this->parse()->getSqlExecutor();

                 // To-be cached item is parserResult
                 $cacheDriver->save($hash, $this->_parserResult->toCachedForm(), $this->_queryCacheTTL);
@@ -334,7 +335,7 @@
                 $executor = $this->_parserResult->getSqlExecutor();
             }
         } else {
-            $executor = $this->_parse()->getSqlExecutor();
+            $executor = $this->parse()->getSqlExecutor();
         }

         // Assignments for Hydrator and Enums

Modified: branches/experimental/jepso-dql-parser-rewrite/tests/Orm/Query/AllTests.php
===================================================================
--- branches/experimental/jepso-dql-parser-rewrite/tests/Orm/Query/AllTests.php 2008-05-13 21:20:34 UTC (rev 4364)
+++ branches/experimental/jepso-dql-parser-rewrite/tests/Orm/Query/AllTests.php 2008-05-16 19:09:48 UTC (rev 4365)
@@ -5,7 +5,7 @@

 require_once 'lib/DoctrineTestInit.php';

-//require_once 'IdentifierRecognitionTest.php';
+require_once 'IdentifierRecognitionTest.php';
 require_once 'ScannerTest.php';
 require_once 'DqlGenerationTest.php';
 require_once 'DeleteSqlGenerationTest.php';
@@ -24,7 +24,7 @@
     {
         $suite = new Doctrine_TestSuite('Doctrine Orm Query');

-        //$suite->addTestSuite('Orm_Query_IdentifierRecognitionTest');
+        $suite->addTestSuite('Orm_Query_IdentifierRecognitionTest');
         $suite->addTestSuite('Orm_Query_ScannerTest');
         $suite->addTestSuite('Orm_Query_DqlGenerationTest');
         $suite->addTestSuite('Orm_Query_DeleteSqlGenerationTest');

Modified: branches/experimental/jepso-dql-parser-rewrite/tests/Orm/Query/IdentifierRe cognitionTest.php
===================================================================
--- branches/experimental/jepso-dql-parser-rewrite/tests/Orm/Query/IdentifierRe cognitionTest.php       2008-05-13 21:20:34 UTC (rev 4364)
+++ branches/experimental/jepso-dql-parser-rewrite/tests/Orm/Query/IdentifierRe cognitionTest.php       2008-05-16 19:09:48 UTC (rev 4365)
@@ -36,10 +36,10 @@
     public function testSingleAliasDeclarationIsSupported()
     {
         $query = new Doctrine_Query;
-        $query->setDql('FROM CmsUser u');
-        $query->parse();
+        $query->setDql('SELECT u.* FROM CmsUser u');
+        $parserResult = $query->parse();

-        $decl = $query->getQueryComponent('u');
+        $decl = $parserResult->getQueryComponent('u');

         $this->assertTrue($decl['metadata'] instanceof Doctrine_ClassMetadata);
         $this->assertEquals(null, $decl['relation']);
@@ -51,10 +51,10 @@
     public function testSingleAliasDeclarationWithIndexByIsSupported()
     {
         $query = new Doctrine_Query;
-        $query->setDql('FROM CmsUser u INDEX BY name');
-        $query->parse();
+        $query->setDql('SELECT u.* FROM CmsUser u INDEX BY name');
+        $parserResult = $query->parse();

-        $decl = $query->getQueryComponent('u');
+        $decl = $parserResult->getQueryComponent('u');

         $this->assertTrue($decl['metadata'] instanceof Doctrine_ClassMetadata);
         $this->assertEquals(null, $decl['relation']);
@@ -66,10 +66,10 @@
     public function testQueryParserSupportsMultipleAliasDeclarations()
     {
         $query = new Doctrine_Query;
-        $query->setDql('FROM User u INDEX BY name LEFT JOIN u.Phonenumber p');
-        $query->parse();
+        $query->setDql('SELECT u.* FROM User u INDEX BY name LEFT JOIN u.Phonenumber p');
+        $parserResult = $query->parse();

-        $decl = $query->getQueryComponent('u');
+        $decl = $parserResult->getQueryComponent('u');

         $this->assertTrue($decl['metadata'] instanceof Doctrine_ClassMetadata);
         $this->assertEquals(null, $decl['relation']);
@@ -77,7 +77,7 @@
         $this->assertEquals(null, $decl['agg']);
         $this->assertEquals('name', $decl['map']);

-        $decl = $query->getQueryComponent('p');
+        $decl = $parserResult->getQueryComponent('p');

         $this->assertTrue($decl['metadata'] instanceof Doctrine_ClassMetadata);
         $this->assertTrue($decl['relation'] instanceof Doctrine_Relation);
@@ -89,10 +89,10 @@
     public function testQueryParserSupportsMultipleAliasDeclarationsWithIndexBy()
     {
         $query = new Doctrine_Query;
-        $query->setDql('FROM User u INDEX BY name LEFT JOIN u.UserGroup g INNER JOIN g.Phonenumber p INDEX BY phonenumber');
-        $query->parse();
+        $query->setDql('SELECT u.* FROM User u INDEX BY name LEFT JOIN u.UserGroup g INNER JOIN g.Phonenumber p INDEX BY phonenumber');
+        $parserResult = $query->parse();

-        $decl = $query->getQueryComponent('u');
+        $decl = $parserResult->getQueryComponent('u');

         $this->assertTrue($decl['metadata'] instanceof Doctrine_ClassMetadata);
         $this->assertEquals(null, $decl['relation']);
@@ -100,7 +100,7 @@
         $this->assertEquals(null, $decl['agg']);
         $this->assertEquals('name', $decl['map']);

-        $decl = $query->getQueryComponent('g');
+        $decl = $parserResult->getQueryComponent('g');

         $this->assertTrue($decl['metadata'] instanceof Doctrine_ClassMetadata);
         $this->assertTrue($decl['relation'] instanceof Doctrine_Relation);
@@ -108,7 +108,7 @@
         $this->assertEquals(null, $decl['agg']);
         $this->assertEquals('name', $decl['map']);

-        $decl = $query->getQueryComponent('p');
+        $decl = $parserResult->getQueryComponent('p');

         $this->assertTrue($decl['metadata'] instanceof Doctrine_ClassMetadata);
         $this->assertTrue($decl['relation'] instanceof Doctrine_Relation);

Modified: branches/experimental/jepso-dql-parser-rewrite/tests/Orm/Query/LanguageReco gnitionTest.php
===================================================================
--- branches/experimental/jepso-dql-parser-rewrite/tests/Orm/Query/LanguageReco gnitionTest.php 2008-05-13 21:20:34 UTC (rev 4364)
+++ branches/experimental/jepso-dql-parser-rewrite/tests/Orm/Query/LanguageReco gnitionTest.php 2008-05-16 19:09:48 UTC (rev 4365)
@@ -34,12 +34,12 @@

     public function testPlainFromClauseWithoutAlias()
     {
-        $this->assertValidDql('FROM User');
+        $this->assertValidDql('SELECT * FROM User');
     }

     public function testPlainFromClauseWithAlias()
     {
-        $this->assertValidDql('FROM User u');
+        $this->assertValidDql('SELECT u.* FROM User u');
     }

     public function testSelectSingleComponentWithAsterisk()
@@ -79,27 +79,27 @@

     public function testArithmeticExpressionsSupportedInWherePart()
     {
-        $this->assertValidDql('FROM Account a WHERE ((a.amount + 5000) * a.amount + 3) < 10000000');
+        $this->assertValidDql('SELECT a.* FROM Account a WHERE ((a.amount + 5000) * a.amount + 3) < 10000000');
     }

     public function testInExpressionSupportedInWherePart()
     {
-        $this->assertValidDql('FROM User WHERE User.id IN (1, 2)');
+        $this->assertValidDql('SELECT * FROM User WHERE User.id IN (1, 2)');
     }

     public function testNotInExpressionSupportedInWherePart()
     {
-        $this->assertValidDql('FROM User WHERE User.id NOT IN (1)');
+        $this->assertValidDql('SELECT * FROM User WHERE User.id NOT IN (1)');
     }

     public function testExistsExpressionSupportedInWherePart()
     {
-        $this->assertValidDql('FROM User WHERE EXISTS (SELECT g.id FROM UserGroupuser g WHERE g.user_id = u.id)');
+        $this->assertValidDql('SELECT * FROM User WHERE EXISTS (SELECT g.id FROM UserGroupuser g WHERE g.user_id = u.id)');
     }

     public function testNotExistsExpressionSupportedInWherePart()
     {
-        $this->assertValidDql('FROM User WHERE NOT EXISTS (SELECT g.id FROM UserGroupuser g WHERE g.user_id = u.id)');
+        $this->assertValidDql('SELECT * FROM User WHERE NOT EXISTS (SELECT g.id FROM UserGroupuser g WHERE g.user_id = u.id)');
     }

     public function testLiteralValueAsInOperatorOperandIsSupported()
@@ -185,22 +185,22 @@

     public function testLeftJoin()
     {
-        $this->assertValidDql('FROM User u LEFT JOIN u.UserGroup');
+        $this->assertValidDql('SELECT * FROM User u LEFT JOIN u.UserGroup');
     }

     public function testJoin()
     {
-        $this->assertValidDql('FROM User u JOIN u.UserGroup');
+        $this->assertValidDql('SELECT u.* FROM User u JOIN u.UserGroup');
     }

     public function testInnerJoin()
     {
-        $this->assertValidDql('FROM User u INNER JOIN u.UserGroup');
+        $this->assertValidDql('SELECT * FROM User u INNER JOIN u.UserGroup');
     }

     public function testMultipleLeftJoin()
     {
-        $this->assertValidDql('FROM User u LEFT JOIN u.UserGroup LEFT JOIN u.Phonenumber');
+        $this->assertValidDql('SELECT * FROM User u LEFT JOIN u.UserGroup LEFT JOIN u.Phonenumber');
     }

     public function testMultipleInnerJoin()
@@ -250,7 +250,7 @@

     public function testSubselectInInExpression()
     {
-        $this->assertValidDql("FROM User u WHERE u.id NOT IN (SELECT u2.id FROM User u2 WHERE u2.name = 'zYne')");
+        $this->assertValidDql("SELECT * FROM User u WHERE u.id NOT IN (SELECT u2.id FROM User u2 WHERE u2.name = 'zYne')");
     }

     public function testSubselectInSelectPart()
@@ -260,12 +260,12 @@

     public function testPositionalInputParameter()
     {
-        $this->assertValidDql('FROM User u WHERE u.id = ?');
+        $this->assertValidDql('SELECT * FROM User u WHERE u.id = ?');
     }

     public function testNamedInputParameter()
     {
-        $this->assertValidDql('FROM User u WHERE u.id = :id');
+        $this->assertValidDql('SELECT * FROM User u WHERE u.id = :id');
     }

     public function testCustomJoinsAndWithKeywordSupported()
@@ -280,42 +280,42 @@

     public function testIndexByClauseWithOneComponent()
     {
-        $this->assertValidDql('FROM Record_City c INDEX BY name');
+        $this->assertValidDql('SELECT * FROM Record_City c INDEX BY name');
     }

     public function testIndexBySupportsJoins()
     {
-        $this->assertValidDql('FROM Record_Country c LEFT JOIN c.City c2 INDEX BY name');
+        $this->assertValidDql('SELECT * FROM Record_Country c LEFT JOIN c.City c2 INDEX BY name');
     }

     public function testIndexBySupportsJoins2()
     {
-        $this->assertValidDql('FROM User u INDEX BY name LEFT JOIN u.Phonenumber p INDEX BY phonenumber');
+        $this->assertValidDql('SELECT * FROM User u INDEX BY name LEFT JOIN u.Phonenumber p INDEX BY phonenumber');
     }

     public function testBetweenExpressionSupported()
     {
-        $this->assertValidDql("FROM User u WHERE u.name BETWEEN 'jepso' AND 'zYne'");
+        $this->assertValidDql("SELECT * FROM User u WHERE u.name BETWEEN 'jepso' AND 'zYne'");
     }

     public function testNotBetweenExpressionSupported()
     {
-        $this->assertValidDql("FROM User u WHERE u.name NOT BETWEEN 'jepso' AND 'zYne'");
+        $this->assertValidDql("SELECT * FROM User u WHERE u.name NOT BETWEEN 'jepso' AND 'zYne'");
     }

     public function testAllExpression()
     {
-        $this->assertValidDql('FROM Employee e WHERE e.salary > ALL (SELECT m.salary FROM Manager m WHERE m.department = e.department)');
+        $this->assertValidDql('SELECT * FROM Employee e WHERE e.salary > ALL (SELECT m.salary FROM Manager m WHERE m.department = e.department)');
     }

     public function testAnyExpression()
     {
-        $this->assertValidDql('FROM Employee e WHERE e.salary > ANY (SELECT m.salary FROM Manager m WHERE m.department = e.department)');
+        $this->assertValidDql('SELECT * FROM Employee e WHERE e.salary > ANY (SELECT m.salary FROM Manager m WHERE m.department = e.department)');
     }

     public function testSomeExpression()
     {
-        $this->assertValidDql('FROM Employee e WHERE e.salary > SOME (SELECT m.salary FROM Manager m WHERE m.department = e.department)');
+        $this->assertValidDql('SELECT * FROM Employee e WHERE e.salary > SOME (SELECT m.salary FROM Manager m WHERE m.department = e.department)');
     }

     public function testLikeExpression()


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google