database table Structure Document auto-generation tool

Source: Internet
Author: User

1. Requirements Description:

After the software development is completed, the delivery customer usually needs the database design document before the customer uses, many programmers even the project manager naturally thought to adopt human sea tactics, a project group member, sub-module to write, then merges. As programmers, this approach is too low. So can there be automated tools, of course, with degrees Niang search "database document Generator" will come out many, their quality will be uneven, or format does not meet the company document format needs. So the ultimate solution to this problem is to understand the principle of database document generator, and then do it yourself, it sounds difficult, it is not easy to achieve, no picture no truth, first.

2. Technical Point Analysis:

The above generated is not very cool, now we are in step by step analysis is how to generate.

The tools you need

Role

Microsot Office

Used to generate a Word document template

Development language

Java

Freemarker

Java Template language

Jdbc

Using JDBC to get the definition of a table

This problem can be split into:

    1. Word document Template: Ordinary doc, docx are binary files, the operation is more troublesome, then we can use the alternative way, in Word XML format.

Save a look at what the doc in XML format looks like:

Heavenly Book of the same XML, is not very broken, in fact, you do not need to fully understand, understand the structure, find out what you care about, if you can not go back and forth more than a few times.

    1. Table structure meta-data:

The classmate who writes Java, should know this is what, perhaps you have not used, but he is existence.

    1. Combine templates and metadata to generate the documents we need.

From the template XML, find the part that needs to be looped, plus the foreach tag:

OK, now that the data has, the template has, the problem is solved.

3. Code implementation:

1. Get a list of table structures:

2. Generate a doc file from a template

4. PostScript:

With the idea of template + data, you can produce documents of any format in complex format, such as generating "* * * * * * * * * * * * * * * * * * *", and can reduce the development difficulty, improve development speed.

Java Development, Internet architecture discussion QQ Group: 297702426

Email: [Email protected]

database table Structure Document auto-generation tool

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.