Package me.ahoo.cosid.mybatis
Class CosIdInterceptor
java.lang.Object
me.ahoo.cosid.mybatis.CosIdInterceptor
- All Implemented Interfaces:
org.apache.ibatis.plugin.Interceptor
@Intercepts(@Signature(type=org.apache.ibatis.executor.Executor.class,method="update",args={org.apache.ibatis.mapping.MappedStatement.class,java.lang.Object.class}))
public class CosIdInterceptor
extends Object
implements org.apache.ibatis.plugin.Interceptor
Fills the
CosId ids of an INSERT's parameter before it runs: the entity itself, or each
entity of the collection under listKey of a multi-parameter map (a batch insert,
insertAll(@Param("list") List<Order> orders)).-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe parameter name of a batch insert's entities by default, MyBatis' own for a single collection parameter. -
Constructor Summary
ConstructorsConstructorDescriptionCosIdInterceptor(me.ahoo.cosid.accessor.IdFiller filler) An interceptor of the default list key.CosIdInterceptor(me.ahoo.cosid.accessor.IdFiller filler, String listKey) An interceptor. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.ibatis.plugin.Interceptor
plugin, setProperties
-
Field Details
-
DEFAULT_LIST_KEY
The parameter name of a batch insert's entities by default, MyBatis' own for a single collection parameter.- See Also:
-
-
Constructor Details
-
CosIdInterceptor
public CosIdInterceptor(me.ahoo.cosid.accessor.IdFiller filler) An interceptor of the default list key.- Parameters:
filler- the filler
-
CosIdInterceptor
An interceptor.- Parameters:
filler- the fillerlistKey- the parameter name of a batch insert's entities
-
-
Method Details
-
listKey
The parameter name of a batch insert's entities.- Returns:
- the key
-
intercept
- Specified by:
interceptin interfaceorg.apache.ibatis.plugin.Interceptor- Throws:
Throwable
-