+ "). ProviderContext can not define multiple in SqlProvider method argument."); this.providerContext = new ProviderContext(mapperType, mapperMethod); this.providerContextIndex = i;
private static String __build__(ProviderContext context, Object params, EntityBuilder entityBuilder) { //Map<String, Object> Method mapperMethod = context.getMapperMethod(); String source = sqlSources.get(mapperMethod); if (source != null) { return source; } synchronized (mapperMethod) { source = sqlSources.get(mapperMethod); if (source != null) { return source; } Class<?> mapperType = context.getMapperType(); Class<?>[] generics = MapperBuilders.getMapperGenerics(mapperType); Class<?> entityClass = generics[0]; EntityMetaData entityMetaData = PersistentRecognizer.entityMetaData(entityClass); source = entityBuilder.build(entityMetaData); // source = ScriptWrapper.quoteScript(source); sqlSources.put(mapperMethod, source); return source; } }
public static String build(ProviderContext context, Object params) { String methodName = context.getMapperMethod().getName(); Method method = ReflectionUtils.findMethod(MapperBuilder.class, methodName, ProviderContext.class, Object.class); return (String) ReflectionUtils.invokeMethod(method, null, context, params); }