File tree Expand file tree Collapse file tree 2 files changed +10
-10
lines changed
src/main/java/org/apache/ibatis Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -153,7 +153,7 @@ private void settingsElement(XNode context) throws Exception {
153
153
}
154
154
configuration .setAutoMappingBehavior (AutoMappingBehavior .valueOf (stringValueOf (props .getProperty ("autoMappingBehavior" ), "PARTIAL" )));
155
155
configuration .setCacheEnabled (booleanValueOf (props .getProperty ("cacheEnabled" ), true ));
156
- configuration .setLazyLoadingEnabled (booleanValueOf (props .getProperty ("lazyLoadingEnabled" ), safeCglibCheck () ));
156
+ configuration .setLazyLoadingEnabled (booleanValueOf (props .getProperty ("lazyLoadingEnabled" ), false ));
157
157
configuration .setAggressiveLazyLoading (booleanValueOf (props .getProperty ("aggressiveLazyLoading" ), true ));
158
158
configuration .setMultipleResultSetsEnabled (booleanValueOf (props .getProperty ("multipleResultSetsEnabled" ), true ));
159
159
configuration .setUseColumnLabel (booleanValueOf (props .getProperty ("useColumnLabel" ), true ));
@@ -163,14 +163,6 @@ private void settingsElement(XNode context) throws Exception {
163
163
}
164
164
}
165
165
166
- private boolean safeCglibCheck () {
167
- try {
168
- return Resources .classForName ("net.sf.cglib.proxy.Enhancer" ) != null ;
169
- } catch (Exception e ) {
170
- return false ;
171
- }
172
- }
173
-
174
166
private void environmentsElement (XNode context ) throws Exception {
175
167
if (context != null ) {
176
168
if (environment == null ) {
Original file line number Diff line number Diff line change 22
22
import org .apache .ibatis .executor .statement .RoutingStatementHandler ;
23
23
import org .apache .ibatis .executor .statement .StatementHandler ;
24
24
import org .apache .ibatis .io .ResolverUtil ;
25
+ import org .apache .ibatis .io .Resources ;
25
26
import org .apache .ibatis .mapping .*;
26
27
import org .apache .ibatis .parsing .XNode ;
27
28
import org .apache .ibatis .plugin .Interceptor ;
@@ -131,6 +132,13 @@ public boolean isLazyLoadingEnabled() {
131
132
}
132
133
133
134
public void setLazyLoadingEnabled (boolean lazyLoadingEnabled ) {
135
+ if (lazyLoadingEnabled ) {
136
+ try {
137
+ Resources .classForName ("net.sf.cglib.proxy.Enhancer" );
138
+ } catch (Throwable e ) {
139
+ throw new IllegalArgumentException ("Cannot enable lazy loading because CGLIB is not available. Add CGLIB to your classpath." , e );
140
+ }
141
+ }
134
142
this .lazyLoadingEnabled = lazyLoadingEnabled ;
135
143
}
136
144
@@ -525,7 +533,7 @@ protected void checkLocallyForDiscriminatedNestedResultMaps(ResultMap rm) {
525
533
}
526
534
}
527
535
}
528
-
536
+
529
537
protected static class StrictMap <J extends String , K extends Object > extends HashMap <J , K > {
530
538
531
539
private String name ;
You can’t perform that action at this time.
0 commit comments