In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article will explain in detail the example analysis of iBATIS configuration class and operation class. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.
Introduction to iBATIS configuration class
IBATIS configuration class 1, SqlMapFactoryBean has three variables configLocation-- configuration file storage address, sqlmap-- read the configuration file, the generated object, sqlMapProperties.
Spring uses the SqlMapFactoryBean class to read ibatis's configuration file and create a sqlmap. IBATIS reads resources from classpath, so make sure the configuration file is on top of classpath.
* cases:
< bean id= "sqlMap" class= "org.springframework.orm.ibatis.SqlMapFactoryBean" > < property name= "configLocation" > < value > classpath:/sql-map-config.xml < / value > < / property > < / bean >
The sql-map-config.xml file is stored in the src directory.
The second kind of request:
< bean id= "sqlMap" class= "org.springframework.orm.ibatis.SqlMapFactoryBean" > < property name= "configLocation" > < value > WEB-INF/sqlmap-config.xml < / value > < / property > < / bean >
The sql-map-config.xml file is stored in the web-info directory.
Now that sqlmap is defined, you must write a configuration file for iBATIS.
< sql-map-config > < settings statementCacheSize= "0" driverHintsEnabled= "true" / > < sql-map resource= "com/longtop/bas/BasSql.xml" / > < / sql-map-config >
IBATIS configuration class 2, SqlMap object.
Objects generated by xml files are mainly read by SqlMapFactoryBean. There is only one SqlMap object (singleton object) in a project, and SqlMap is equivalent to all ibatis configuration files. Spring invokes SqlMapFactoryBean to generate a SqlMap object and injects the SqlMap object into each SqlDao object (inheriting SqlMapDaoSupport).
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.