In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly introduces the use of mybatis.type-aliases-package, the article is very detailed, has a certain reference value, interested friends must read it!
The crater of mybatis.type-aliases-package
Custom POJO is often used in resultType in mapper.xml, and you can specify references to these POJO with fully qualified names.
For example:
Or you can have mybatis scan to a custom POJO automatically by specifying a POJO scan package in application.properties
As follows:
Mybatis.type-aliases-package=com.majing.learning.mybatis.entity
However, please be careful not to follow the word classpath after mybatis.type-aliases-package=, otherwise mybatis will not find POJO.
The function and usage of mybatis.type-aliases-package
Custom POJO is used in the type or parameterType of resultMap in the mapper.xml file.
For example:
Select * from User select * from User where username=# {username} select password from user where username=# {username} insert into user (username,password) value (# {username}, # {password})
In resultType= "User", User is the custom POJO. You can use the fully qualified name to specify the references to these POJO.
For example:
The second method is to use mybatis.type-aliases-package to specify the POJO scan package to have mybatis scan to the custom POJO automatically.
Configure the following information in the application.propertites configuration file: mybatis.type-aliases-package=com.example.entity
Mybatis.type-aliases-package=com.example.demo.entity above is all the content of this article "what's the use of mybatis.type-aliases-package?" Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
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: 229
*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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.