1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.apache.ibatis.submitted.custom_collection_handling;
17
18 import org.apache.ibatis.reflection.MetaObject;
19 import org.apache.ibatis.reflection.wrapper.ObjectWrapper;
20 import org.apache.ibatis.reflection.wrapper.ObjectWrapperFactory;
21
22 public class CustomObjectWrapperFactory implements ObjectWrapperFactory {
23
24 @Override
25 public boolean hasWrapperFor(Object object) {
26 return object.getClass().equals(CustomCollection.class);
27 }
28
29 @Override
30 public ObjectWrapper getWrapperFor(MetaObject metaObject, Object object) {
31 return new CustomObjectWrapper((CustomCollection) object);
32 }
33
34 }