Skip to content

Commit

Permalink
Try Assoc-Id Mapping with Id that has its column renamed.
Browse files Browse the repository at this point in the history
  • Loading branch information
beberlei committed Aug 15, 2010
1 parent fb44fa6 commit 772e592
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions tests/Doctrine/Tests/ORM/Functional/Ticket/DDC117Test.php
Expand Up @@ -93,6 +93,7 @@ public function testUpdateAssocationEntity()
$idCriteria = array('source' => $this->article1->id(), 'target' => $this->article2->id());

$mapRef = $this->_em->find(__NAMESPACE__."\DDC117Reference", $idCriteria);
$this->assertNotNull($mapRef);
$mapRef->setDescription("New Description!!");
$this->_em->flush();
$this->_em->clear();
Expand Down Expand Up @@ -240,7 +241,7 @@ public function testOneToOneForeignObjectId()
*/
class DDC117Article
{
/** @Id @Column(type="integer") @GeneratedValue */
/** @Id @Column(type="integer", name="article_id") @GeneratedValue */
private $id;
/** @Column */
private $title;
Expand Down Expand Up @@ -303,7 +304,11 @@ public function getText()
*/
class DDC117ArticleDetails
{
/** @Id @OneToOne(targetEntity="DDC117Article", inversedBy="details") */
/**
* @Id
* @OneToOne(targetEntity="DDC117Article", inversedBy="details")
* @JoinColumn(name="article_id", referencedColumnName="article_id")
*/
private $article;

/**
Expand Down Expand Up @@ -336,12 +341,16 @@ public function getText()
class DDC117Reference
{
/**
* @Id @ManyToOne(targetEntity="DDC117Article", inversedBy="references")
* @Id
* @ManyToOne(targetEntity="DDC117Article", inversedBy="references")
* @JoinColumn(name="source_id", referencedColumnName="article_id")
*/
private $source;

/**
* @Id @ManyToOne(targetEntity="DDC117Article", inversedBy="references")
* @Id
* @ManyToOne(targetEntity="DDC117Article", inversedBy="references")
* @JoinColumn(name="target_id", referencedColumnName="article_id")
*/
private $target;

Expand Down Expand Up @@ -393,7 +402,9 @@ public function getDescription()
class DDC117Translation
{
/**
* @Id @ManyToOne(targetEntity="DDC117Article")
* @Id
* @ManyToOne(targetEntity="DDC117Article")
* @JoinColumn(name="article_id", referencedColumnName="article_id")
*/
private $article;

Expand Down

0 comments on commit 772e592

Please sign in to comment.