In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-20 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: 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.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.