Usage of mybatis @ alias annotation on classes (recommended)

For example, use the annotation @ alias ("ddebtentity") on the class

Then in mapper Resulttype = "ddebtentity" in XML file

In mybatisconfig In XML

Sqlsessionfactory needs to configure the path for annotation scanning

Three methods of typealias configuration of mybatis

1. Define alias:

2. Scanning package method:

3. Annotation method:

summary

The above is how Xiaobian introduced the mybatis @ alias annotation on the class. I hope it will help you. If you have any questions, please leave me a message and Xiaobian will reply to you in time. Thank you very much for your support for the programming tips website!

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>