title: Doctrine2: related keys
body: <p>I have following table (type, id, title). </p>
  
  <p>When new object is created and type=1 id should be 1, next object with type=1 id=2... But when I create object with type=2 id should be 1.</p>
  
  <p>How can I do it with Doctrine2 and Symfony2?</p>