Sql2java for lazy tool design

Source: Internet
Author: User
Sql2java for lazy tool design

When I went to Xiamen on May Day, I suddenly wanted to prepare some tools on the train to replace them.Program(I think as a programmer, I often do some physical work like Ctrl + C and CTRL + V, such as writing some JavaBean and writing insert, update, which are similar in the service, delete ). These things are actually regular and predictable, and if I can write some tools, I can automatically implement these features, so that I can put more timeCodeHow can optimization and other things improve the company's work efficiency?

The overall planning is like this. As an Eclipse plug-in, you can directly generate the corresponding manager and service based on the JavaBean, and generate some common methods in the Manager and service, such as insert, update, delete, you can even specify the field query. What should I do when I think of this JavaBean? How can I generate it? Can I generate a corresponding JavaBean directly based on a created table? It is a bit similar to java2hbm and hbm2java, but I think it can be implemented. So now the first step is to implement "generate corresponding JavaBean for given SQL" ----- This is the origin of sql2java name, but I don't know if some cool guys have done it.

Preliminary assumption: sql2java supports MySQL and Oracle DDL. DDL of other DBMS will be added later. To analyze SQL to generate a JavaBean, the basic task is to analyze SQL statements, I am currently considering whether to write a lexical analyzer by myself or directly use anlr for analysis.

I just returned to Beijing today. When I went to gulangyu for a visit, it rained heavily. Now I still have a cold. I have to go to bed first. I will try again tomorrow.

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.