mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-07 09:08:24 +08:00
fix:多listener缺失问题
This commit is contained in:
parent
01a6ba6892
commit
9fa2d5df2f
@ -221,13 +221,15 @@ public class FlexGlobalConfig {
|
|||||||
|
|
||||||
private void doGetSupportedSetListener(Class<?> childClass, Map<Class<?>, SetListener> listeners) {
|
private void doGetSupportedSetListener(Class<?> childClass, Map<Class<?>, SetListener> listeners) {
|
||||||
SetListener setListener = null;
|
SetListener setListener = null;
|
||||||
|
Class<?> listenersMapKey = null;
|
||||||
while (setListener == null && childClass != null) {
|
while (setListener == null && childClass != null) {
|
||||||
setListener = entitySetListeners.get(childClass);
|
setListener = entitySetListeners.get(childClass);
|
||||||
|
listenersMapKey = childClass.getSuperclass() == null ? childClass : childClass.getSuperclass();
|
||||||
childClass = childClass.getSuperclass();
|
childClass = childClass.getSuperclass();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (setListener != null) {
|
if (setListener != null) {
|
||||||
listeners.put(childClass, setListener);
|
listeners.put(listenersMapKey, setListener);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -264,13 +266,15 @@ public class FlexGlobalConfig {
|
|||||||
|
|
||||||
private void doGetSupportedUpdateListener(Class<?> childClass, Map<Class<?>, UpdateListener> listeners) {
|
private void doGetSupportedUpdateListener(Class<?> childClass, Map<Class<?>, UpdateListener> listeners) {
|
||||||
UpdateListener updateListener = null;
|
UpdateListener updateListener = null;
|
||||||
|
Class<?> listenersMapKey = null;
|
||||||
while (updateListener == null && childClass != null) {
|
while (updateListener == null && childClass != null) {
|
||||||
updateListener = entityUpdateListeners.get(childClass);
|
updateListener = entityUpdateListeners.get(childClass);
|
||||||
|
listenersMapKey = childClass.getSuperclass() == null ? childClass : childClass.getSuperclass();
|
||||||
childClass = childClass.getSuperclass();
|
childClass = childClass.getSuperclass();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (updateListener != null) {
|
if (updateListener != null) {
|
||||||
listeners.put(childClass, updateListener);
|
listeners.put(listenersMapKey, updateListener);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -307,13 +311,15 @@ public class FlexGlobalConfig {
|
|||||||
|
|
||||||
private void doGetSupportedInsertListener(Class<?> childClass, Map<Class<?>, InsertListener> listeners) {
|
private void doGetSupportedInsertListener(Class<?> childClass, Map<Class<?>, InsertListener> listeners) {
|
||||||
InsertListener insertListener = null;
|
InsertListener insertListener = null;
|
||||||
|
Class<?> listenersMapKey = null;
|
||||||
while (insertListener == null && childClass != null) {
|
while (insertListener == null && childClass != null) {
|
||||||
insertListener = entityInsertListeners.get(childClass);
|
insertListener = entityInsertListeners.get(childClass);
|
||||||
|
listenersMapKey = childClass.getSuperclass() == null ? childClass : childClass.getSuperclass();
|
||||||
childClass = childClass.getSuperclass();
|
childClass = childClass.getSuperclass();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (insertListener != null) {
|
if (insertListener != null) {
|
||||||
listeners.put(childClass, insertListener);
|
listeners.put(listenersMapKey, insertListener);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user