You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reporter: Eli Kizhnerman
The iBatis plugin does not seem to be resolving the target methods to
intercept properly. An interceptor that is defined to intercept only
updates is also executed on inserts.
I have the following definition:
@Intercepts({@Signature(
type=Executor.class,
method="update",
args={MappedStatement.class,Object.class})})
public class UpdateInterceptor implements Interceptor {
...
}
In Plugin.invoke you have the following code:
Set<Method> methods = signatureMap.get(method.getDeclaringClass());
if (methods != null && methods.contains(method)) {
return interceptor.intercept(new Invocation(target, method, args));
}
DefaultSqlSession.insert internally calls an update method:
public int insert(String statement, Object parameter) {
return update(statement, parameter);
}
I suspect that the Method that is being passed to plugin.invoke is actually
the update method and therefore the interceptor is executed.
Original issue reported on code.google.com by clinton....@gmail.com on 17 May 2010 at 1:39
The text was updated successfully, but these errors were encountered:
Clinton Begin added a comment - 10/Dec/09 03:58 PM
Executor only has update and query methods. Thus inserts and deletes are also
considered updates. It sounds like to do what you want, we need another
interception
point, at the session level. You can do so right now with a proxy class between
the
SqlSession interface and the default implementation.
[ Show » ]
Clinton Begin added a comment - 10/Dec/09 03:58 PM Executor only has update and
query
methods. Thus inserts and deletes are also considered updates. It sounds like
to do
what you want, we need another interception point, at the session level. You
can do
so right now with a proxy class between the SqlSession interface and the default
implementation.
[ Permalink | Delete | « Hide ]
Eli Kizhnerman added a comment - 11/Dec/09 12:28 PM
This is not working the way I expected it but that it is not a bug. I can get
what I
need from the MappedStatement SqlCommandType.
Original comment by clinton....@gmail.com on 17 May 2010 at 1:39
Original issue reported on code.google.com by
clinton....@gmail.com
on 17 May 2010 at 1:39The text was updated successfully, but these errors were encountered: