mysql - Doctrine - One-To-One Bidirectional Relationship not allowed -
i have problem transfer databse design doctrine.
at first details:
i many football-related data xml files , have save in own database.
one part of these data players , player statistic.
here tables:
table: player id | varchar | pk team_id | int ...and many more... table: player_statistic player_id | varchar | pk season_id | smallint | pk competition_id | smallint | pk ...and many more... so player.id part of composite pk player_statistic.
in opinion it's one-to-one bidirectional relationship.
here relevant entity-code:
<?php /** * @entity * @table(name="player") */ class player { /** * @id * @onetoone(targetentity="playerstatistic", mappedby="playerid") */ private $id; /* ... */ } ?> <?php /** * @entity * @table(name="player_statistic") */ class playerstatistic { /** * @id * @onetoone(targetentity="player", inversedby="id") * @joincolumn(name="player_id", referencedcolumnname="id") */ private $playerid; /* ... */ } ?> the cli command:
php53 vendor/bin/doctrine orm:schema-tool:update --dump-sql returns: "an inverse association not allowed identifier in 'player#id'."
is not possible this, or did wrong?
if possible , not totaly rubbish don't want use ai pk fields.
thanks kind of help.
update sorry logical problem it's many (player_statistic) - - 1 (player) relationship.
Comments
Post a Comment