@SuppressWarnings("unchecked")
protected ControllerProxy<?, ?> getDynamicController(Class<?> keyType, Class<?> modelType, ModelMetadata model) {
ControllerProxy<?, ?> proxy = dynamicCrudControllers.get(modelType);
if (proxy == null) {
Call indexCall = routes.RouterCrudController.list(model.getName());
DynamicCrudController dynController = new DynamicCrudController(classLoader, model, indexCall);
proxy = new ControllerProxyCRUD<>(dynController, model);
dynamicCrudControllers.put(modelType, proxy);
}
return proxy;