#1240: Cannot use DQL Update and Delete Statement with inheritance
------------------------------+---------------------------------------------
  Reporter:  Eki              |       Owner:  romanb                          
      Type:  defect           |      Status:  new                             
  Priority:  major            |   Milestone:  2.0.0                           
 Component:  Query/Hydration  |     Version:  Trunk                           
Resolution:                   |    Keywords:  inheritance, dql, update, delete
  Has_test:  0                |    Mystatus:  Pending Core Response           
 Has_patch:  0                |  
------------------------------+---------------------------------------------
Comment (by ccunningham):

 I'm getting the same problem, without involving inheritance.

 This query:

 {{{
         $query = Doctrine_Query::create()
                 ->delete()
                 ->from( 'InvoiceLineItem Item' )
                 ->where( 'Item.id = ?', $id )
                 ->leftJoin( 'Item.Invoice Invoice' )
                 ->leftJoin( 'Invoice.Service Service')
                 ->innerJoin( "Service.Sharing sh ON sh.service_id =
 Service.id AND sh.profile_id = " . $user->getValue('profile_id'));
 }}}


 generates this sql:


 {{{
 DELETE FROM T2_Invoice_Items
      LEFT JOIN T2_Invoices t2 ON t.invoice_id = t2.id
      LEFT JOIN T2_Service t3 ON t2.service_id = t3.id
      INNER JOIN vw_Sharing v ON (v.service_id = t3.id AND v.profile_id =
 474)
 WHERE id = ?
 }}}

 No class table inheritance here. The lack of an alias being applied to the
 delete query means no joins can be done.

-- 
Ticket URL: <http://trac.doctrine-project.org/ticket/1240#comment:6>
Doctrine <http://www.phpdoctrine.org>
PHP Doctrine Object Relational Mapper
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"doctrine-svn" group.
 To post to this group, send email to [email protected]
 To unsubscribe from this group, send email to [EMAIL PROTECTED]
 For more options, visit this group at 
http://groups.google.co.uk/group/doctrine-svn?hl=en-GB
-~----------~----~----~----~------~----~------~--~---

Reply via email to