Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-52

Eager Load with allowPartialObjects set to TRUE

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 2.0-ALPHA3
    • Fix Version/s: 2.0-ALPHA3
    • Component/s: ORM
    • Security Level: All
    • Labels:
      None
    • Environment:

      Description

      Hello,

      DDC-51 Works fine with allowPartialObjects set to FALSE, i will continue work with this setting.

      but if i set allowPartial objects to TRUE or i commented it out in my DataAccess class. it will not eager load the definitions, proverbs and relation.

      this is my DataAccess class part

      $config = new ORM\Configuration();
      $config->setMetadataCacheImpl(self::$metadataCache);
      $config->setQueryCacheImpl(self::$queryCache);
      $config->setProxyDir(realpath(DOCTRINE_PROXIES_PATH));
      $config->setProxyNamespace('kateglo\proxies');
              	
      self::$entityManager = ORM\EntityManager::create($conn, $config);
      //self::$entityManager->getConfiguration()->setAllowPartialObjects(false);
      

      and this is the code that i tried with the allowPartialObject commented out (i tried it with True too and its the same).

      $query = utilities\DataAccess::getEntityManager()->createQuery("SELECT p, d FROM ".models\Phrase::CLASS_NAME." p JOIN p.definitions d WHERE p.phrase = '$phrase'");        
      $result = $query->getResult();
      $definitions = $result[0]->getDefinitions();
      echo count($definitions);
      

      the result of the echo is 0

      and i even try this one too, and the result is 000

      $query = utilities\DataAccess::getEntityManager()->createQuery("SELECT p, pv, d, r FROM ".models\Phrase::CLASS_NAME." p JOIN p.proverbs pv JOIN p.definitions d JOIN p.relations r WHERE p.phrase = '$phrase'");        
      $result = $query->getResult();
      $proverbs = $result[0]->getProverbs();
      $definitions = $result[0]->getDefinitions();
      $relations = $result[0]->getRelations();
      echo count($proverbs);
      echo count($definitions);
      echo count($relations);
      

        Activity

        Hide
        Roman S. Borschel added a comment -

        Are you sure there is a difference? The allowPartialObjects option is not used anymore. I just removed all references to it in the code itself and removed the option on the Configuration class also.

        If you're using the latest code from trunk, this option does not exist anymore.

        Show
        Roman S. Borschel added a comment - Are you sure there is a difference? The allowPartialObjects option is not used anymore. I just removed all references to it in the code itself and removed the option on the Configuration class also. If you're using the latest code from trunk, this option does not exist anymore.
        Hide
        Arthur Purnama added a comment -

        please stand by,

        my latest ist rev.6524
        im updating now to the latest rev.

        Show
        Arthur Purnama added a comment - please stand by, my latest ist rev.6524 im updating now to the latest rev.

          People

          • Assignee:
            Roman S. Borschel
            Reporter:
            Arthur Purnama
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: