0 votes

Hi,

i'm testing Skipper and whereas i created a new project from mysql workbench model, then i realized that even if associations are well described in Diagram of Skipper, the generated Entities doesn't have any JoinColumn annotation. All foreign keys are also not in the class but in Class annotation as index.

Here is a sample with this class that has a foreign key idagence in the diagram but is not part of the entity property. In place, there is an @ROM\Index with indid_agence (which is the name of the the related index.
/** * @ORM\Entity * @ORM\Table( * name="timeline_agence", * indexes={ * @ORM\Index(name="ind_id_agence", columns={"IdAgence"}) * } * ) */ class timeline_agence { ...

And the Agence Class:
/** * @ORM\Entity * @ORM\Table(name="agence", indexes={@ORM\Index(name="agence_id_concept", columns={"IdConcept"})}) */ class agence { /** * @ORM\Id * @ORM\Column(type="integer", length=11) * @ORM\GeneratedValue(strategy="AUTO") */ private $id_agence; ...

I expected timelineagence to get a property idagence with JOIN annotation. Maybe i missed some config somewhere.

Skipper version: 3.2.15.1478

Thanks

in How To & Manuals by (120 points)
edited by

1 Answer

0 votes

It seems like your MySQL Workbench file doesn't have correctly defined associations and because of that Skipper don't know how to import it.

Would be possible to share your MWB file so we can test it here? If so, please send it to [email protected]

Thanks.

PS: In case you're using Doctrine2, it should be better to import Doctrine2 schema files directly to Skipper instead of importing MWB.

And in case you don't have schema files from your database yet, Doctrine2 offer owns DB importer.

by Skipper developer (141k points)

thanks for help.
Not sure to get the right to send you the mwb (will ask for).

I understand.

Were you able to import your project via Doctrine2 cli tools?

Hi, not possible for instance because there is a lot of table without Primary key. I may fix this with fake column PK.
Finally, I'm sending you the model.
Thanks

Hi,

I'm not sure I understand you. In case you have table without PK, there is no way how to create association.

Check this SO answer: https://stackoverflow.com/questions/35848605/doctrine-manytoone-w-o-a-primary-id-key