From the discussion of the database at the beginning of the month to the present, from changing the design principles to improving the details, this afternoon finally finalized the final database, the next step is to build a UML diagram, first, we need to create an entity class that corresponds to a database table. There are a total of 50 tables in the database. Do we need to compare the tables one by one? Who is so stupid? Well, I did that before.
Is there a simple and feasible method? Programmers certainly need to repeat code, but after that, they should use their talents in design, rather than repeating tedious operations over and over again. The program was originally used to solve complicated problems. As a programmer, it should not do the same thing again. The first thought was to write a program on your own. However, if you encounter many problems such as reading data types and your current level is insufficient, you should first "stand on the shoulders of giants" and finally find a software: entityscodegenerate. Thank you for sharing your ideas.
It is also very convenient to use. Choose database> database string> output location> output item> output language> comment content> to generate code:
The result is as follows:
If you just want to get the corresponding entity class, this is enough, but it is often the case that you need to import the modeling tool as part of the architecture. Before that, the problem was, the generated class file name is definitely not actually needed. Even if the file name is changed, the class name will not change ...... The most important step is to solve the problem. The remaining steps are details: You can use stress to modify file names in batches; you can import them to vs to replace Class names in batches ......
Now we can use the reverse engineering of EA to convert it to a class diagram:
The result is as follows:
I still remember that I used less than 40 tables to draw entity classes based on the database for nearly one morning. This method generally takes less than 10 minutes, and the entity class has a class diagram, use your creativity in design!