Doctrine 2 Bidirectional One to Many Mapping is REALLY SLOW, sanity check
I am just starting out with Doctrine 2 and trying to test out a bidirectional One to Many relationship.  In this case, I have a user, which can have many comments.  I have checked the Doctrine 2 documentation and it seems that I am doing it right, but it takes a really looong time to execute my script (with just a few rows in each tables), and I'm hoping someone can help point me in the right direction.  Here is the php:

    /**
     * @Entity
     * @Table(name="users")
     */
    
    class User
    {

	/**
	 * @Id @GeneratedValue
	 * @Column(type="bigint")
	 * @var integer
	 */
	private $id;

	/**
	 * @Column(type="string", length="250")
	 * @var string
	 */	
	protected $name;	

	/**
	 * @OneToMany(targetEntity="Comment", mappedBy="user")
	 */	
	private $comments;
	
    }

    /**
     * @Entity
     * @Table(name="comments")
     */
    class Comment
    {
	/**
	 * @Id @GeneratedValue
	 * @Column(type="bigint")
	 * @var integer
	 */
	private $id;
	
	/**
	 * @Column(type="text")
	 * @var string
	 */	
	private $text;

	/**
	 * @ManyToOne(targetEntity="User", inversedBy="comments")
	 * @JoinColumn(name="user_id", "referencedColumnName="id")
	 */	
	private $user;
    }


Doctrine 2 Bidirectional One to Many Mapping is REALLY SLOW, sanity check
===

I am just starting out with Doctrine 2 and trying to test out a bidirectional One to Many relationship.  In this case, I have a user, which can have many comments.  I have checked the Doctrine 2 documentation and it seems that I am doing it right, but it takes a really looong time to execute my script (with just a few rows in each tables), and I'm hoping someone can help point me in the right direction.  Here is the php:

    /**
     * @Entity
     * @Table(name="users")
     */
    
    class User
    {

	/**
	 * @Id @GeneratedValue
	 * @Column(type="bigint")
	 * @var integer
	 */
	private $id;

	/**
	 * @Column(type="string", length="250")
	 * @var string
	 */	
	protected $name;	

	/**
	 * @OneToMany(targetEntity="Comment", mappedBy="user")
	 */	
	private $comments;
	
    }

    /**
     * @Entity
     * @Table(name="comments")
     */
    class Comment
    {
	/**
	 * @Id @GeneratedValue
	 * @Column(type="bigint")
	 * @var integer
	 */
	private $id;
	
	/**
	 * @Column(type="text")
	 * @var string
	 */	
	private $text;

	/**
	 * @ManyToOne(targetEntity="User", inversedBy="comments")
	 * @JoinColumn(name="user_id", "referencedColumnName="id")
	 */	
	private $user;
    }

