title: Doctrine Self Referencing is not working in Symfony 1.4 when updating or deleting
body: <p>I'm trying to build a model for content pages on my site, and i gave it a self reference named 'Related Page'. Now if i build my models and try to create a new page in the admin generator everything works fine. If i give the page a related page (or more) it works fine too, but if i go to the other page and try to edit the references symfony crashes:</p>
  
  <pre><code>SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '2-2' for key 'PRIMARY'
  </code></pre>
  
  <p>I checked it in phpmyadmin and noticed that in the association table i have 2 ids (id1 and id2) and only the first id is a link:</p>
  
  <p>(sorry I couldn't paste a link)</p>
  
  <p>I tried to give an 'id' field to the association table so i had 3 fields (id, id1, id2), and i saw that when I update the relations in the other page (page2 to page1 and page2 to page3), it is creating the relations for that page (page2 to page1 and page3) and it is deleting the old relations (it was page1 to page2 and page1 to page3) and the final relations i have in the association table is page1 to page 1 (???) page 2 to page1 and page2 to page3.</p>
  
  <p>My models are:</p>
  
  <pre><code>Page:
  //...
        relations:
          RelatedPages:
            class: Page
            local: id1
            foreign: id2
            refClass: RelatedPage
            equal: true
  
  RelatedPage:
    columns:
      id1:
        type: integer(4)
        primary: true
        unsigned: true
        notnull: true
      id2:
        type: integer(4)
        primary: true
        unsigned: true
        notnull: true
  </code></pre>
  
  <p>I'm using the symfony admin generator. Do I have to write some code to handle this, or am I doing something wrong?</p>
  
  <p>I checked the doctrine documentation:
  <a href="http://www.doctrine-project.org/projects/orm/1.2/docs/manual/defining-models/en#relationships%3ajoin-table-associations%3aself-referencing-nest-relations%3aequal-nest-relations" rel="nofollow">link text</a></p>
  
  <p>and it seems that everything is OK.</p>