When I create my entities I use reverse engineering . That is, I take from the database and symfony generates the entities using these commands :
php bin/console doctrine:mapping:import --force AppBundle --env=local --em=entityManager (Generate metadata from database, add to em the table in db )
php bin/console doctrine:mapping:convert annotation ./src --env=local --em=entityManager (Use the metadata files to generate entities)
php bin/console doctrine:generate:entities AppBundle:Producto --env=local (Add setters and getters of atributtes from each entity)
It manages to map and create an entity just like the database object.
My question is: If I don't need to map the database, I can create the entity from symfony and take that structure to the database in SQL or XML... either mysql, oracle, mongo...
Well, it depends, if it is an already created data set, for some reason, it is appropriate to let doctrine generate the entities from the existing structures. If it is about generating new sets, or modifying existing ones, then generate or modify the affected entities and then run the appropriate tools. There is no correct option, you always have to analyze each case.