Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize ibatis automatic Code Generation

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces how to achieve ibatis automatic code generation, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let Xiaobian take you to understand.

First, obtain

Http://ibatis.apache.org/abator.html

Unpack it to the directory after download

D:\ abator-0.6.5-124

\ abator.jar

\ abator-src.zip

III. Configuration file

Create a new configuration file, config.xml, with the following contents:

Undefined

Here is the Oracle-related configuration, other databases can be analogous, where javaModelGenerator, sqlMapGenerator, daoGenerator is the relevant code will be generated, you can add or delete according to your own needs, a more complete configuration file can see the definition of DTD. Http://ibatis.apache.org/dtd/abator-config_1_0.dtd

4. Run (create a new directory test under the root directory of D disk, and you need to store the generated files)

Java-jar abator.jar config.xml false

Java-jar abator.jar config.xml true

Java-cp abator.jar org.apache.ibatis.abator.api.AbatorRunner config.xml false

Java-cp abator.jar org.apache.ibatis.abator.api.AbatorRunner config.xml true

The above four ways can be run. True/false indicates whether to overwrite the original code.

5. View the generated file and modify it

After a successful operation, you will have the following information:

Abator finshed successfully, there were warninigs

At this point, you can manually modify the generated ibatis automatic code.

Thank you for reading this article carefully. I hope the article "how to achieve ibatis automatic code generation" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report