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.