feat[version]: use javassist to enhance version interface

This commit is contained in:
godotg committed 2024-07-01 13:53:03 +08:00
1 parent 1cb440a5f6
commit a79fdfceda
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -75,7 +75,7 @@ public class EntityCache<PK extends Comparable<PK>, E extends IEntity<PK>> imple
version = cacheVersionReflect; version = cacheVersionReflect;
} else { } else {
try { try {
version = EnhanceUtils.createEventReceiver(cacheVersionReflect); version = EnhanceUtils.createVersion(cacheVersionReflect);
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
@@ -42,7 +42,7 @@ public abstract class EnhanceUtils {
} }
} }
public static IVersion createEventReceiver(VersionReflect cacheVersion) throws NotFoundException, CannotCompileException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException { public static IVersion createVersion(VersionReflect cacheVersion) throws NotFoundException, CannotCompileException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException {
var classPool = ClassPool.getDefault(); var classPool = ClassPool.getDefault();
Class<?> clazz = cacheVersion.getEntityClass(); Class<?> clazz = cacheVersion.getEntityClass();