Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.01 KB | None | 0 0
  1. /**
  2.  * @entity
  3. **/
  4. class EntitaJedna{
  5.  
  6. ... ID sloupec ...
  7.  
  8.         /**
  9.          * @ManyToMany(targetEntity="EntitaDve")
  10.          * @JoinTable(name="tabulka_pro_spojeni_entit",
  11.          *      joinColumns={@JoinColumn(name="jedna_id", referencedColumnName="id")},
  12.          *      inverseJoinColumns={@JoinColumn(name="dve_id", referencedColumnName="id")}
  13.          *      )
  14.          */
  15.         private $entityDve;
  16. }
  17.  
  18. /**
  19.  * @entity
  20. **/
  21. class EntitaDve{
  22.  
  23. ... ID sloupec ...
  24.  
  25.         /**
  26.          * @ManyToMany(targetEntity="EntitaJedna")
  27.          * @JoinTable(name="tabulka_pro_spojeni_entit",
  28.          *      joinColumns={@JoinColumn(name="dve_id", referencedColumnName="id")},
  29.          *      inverseJoinColumns={@JoinColumn(name="jedna_id", referencedColumnName="id")}
  30.          *      )
  31.          */
  32.         private $entityJedna;
  33. }
  34.  
  35. Při updatu schemat pokud mam obě asociace, u jedné to nedělá: The table with name 'tabulka_pro_spojeni_entit' already exists.
  36. // Tohle je pouze příklad ;)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement