Exception parameter not used

.Using DataManager in addGeneratedColumn.

Medio medio = medioEmpleado.getMedio();
LoadContext loadContext = LoadContext.create(Stock.class)
.setQuery(LoadContext.createQuery(“
select s from myapp$Stock s
inner join myapp$Productos p on p.id=s.producto.id
left join myapp$Combinaciones c on c.productos.id=p.id
left join myapp$Almacen alm on alm.id=s.almacen.id
where alm.medio.id= :medioEmp and s.almacen.id=(select a.id from myapp$Almacen a
left join myapp$Medio as m on m.id = a.medio.id and m.almacenMovil=true
left join myapp$MedioEmpleado as me on me.medio.id = a.medio.id
left join myapp$Empleados as e on e.id=me.empleados.id
where a.medio.id = alm.medio.id)
”)
.setParameter(“medioEmp”, medio))
.setView(“stock-view”);

List resultado = dataManager.loadList(loadContext);

“DevelopmentException: Parameter ‘medioEmp’ is not used in the query”

here the full exception:

com.haulmont.cuba.core.global.DevelopmentException: Parameter ‘medioEmp’ is not used in the query
at com.haulmont.cuba.core.app.DataServiceQueryBuilder.getQuery(DataServiceQueryBuilder.java:155)
at com.haulmont.cuba.core.app.RdbmsStore.createQuery(RdbmsStore.java:578)
at com.haulmont.cuba.core.app.RdbmsStore.loadList(RdbmsStore.java:207)
at com.haulmont.cuba.core.app.DataManagerBean.loadList(DataManagerBean.java:84)
at sun.reflect.GeneratedMethodAccessor198.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.haulmont.cuba.core.app.DataManagerBean$SecureDataManagerInvocationHandler.invoke(DataManagerBean.java:362)
at com.sun.proxy.$Proxy318.loadList(Unknown Source)
at com.haulmont.cuba.core.app.DataServiceBean.loadList(DataServiceBean.java:51)
at sun.reflect.GeneratedMethodAccessor197.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:85)
at com.haulmont.cuba.core.sys.ServiceInterceptor.aroundInvoke(ServiceInterceptor.java:117)
at sun.reflect.GeneratedMethodAccessor135.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:629)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:618)
at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:168)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
at com.sun.proxy.$Proxy215.loadList(Unknown Source)
at sun.reflect.GeneratedMethodAccessor359.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.haulmont.cuba.core.sys.remoting.LocalServiceInvokerImpl.invoke(LocalServiceInvokerImpl.java:94)
at com.haulmont.cuba.web.sys.remoting.LocalServiceProxy$LocalServiceInvocationHandler.invoke(LocalServiceProxy.java:154)
at com.sun.proxy.$Proxy29.loadList(Unknown Source)
at com.haulmont.cuba.client.sys.DataManagerClientImpl.loadList(DataManagerClientImpl.java:53)
at com.komenco.komerziaerp.web.empleados.EmpleadosBrowse$1.generateCell(EmpleadosBrowse.java:75)
at com.haulmont.cuba.web.gui.components.WebAbstractTable$6.generateCell(WebAbstractTable.java:1652)
at com.vaadin.ui.Table.parseItemIdToCells(Table.java:2365)
at com.vaadin.ui.Table.getVisibleCellsNoCache(Table.java:2237)
at com.vaadin.ui.Table.refreshRenderedCells(Table.java:1780)
at com.vaadin.ui.Table.refreshRowCache(Table.java:2687)
at com.vaadin.ui.Table.containerItemSetChange(Table.java:4616)
at com.vaadin.data.util.ContainerOrderedWrapper$PiggybackListener.containerItemSetChange(ContainerOrderedWrapper.java:706)
at com.haulmont.cuba.web.gui.data.CollectionDsWrapper.fireItemSetChanged(CollectionDsWrapper.java:109)
at com.haulmont.cuba.web.gui.data.CollectionDsWrapper$ContainerDatasourceCollectionChangeListener.collectionChanged(CollectionDsWrapper.java:270)
at com.haulmont.cuba.web.gui.components.WebGroupTable$GroupTableDsWrapper$3.collectionChanged(WebGroupTable.java:785)
at com.haulmont.bali.events.EventRouter.fireEvent(EventRouter.java:45)
at com.haulmont.cuba.gui.data.impl.CollectionDsListenersWrapper.collectionChanged(CollectionDsListenersWrapper.java:53)
at com.haulmont.cuba.web.gui.components.WebAbstractTable$TableCollectionDsListenersWrapper.collectionChanged(WebAbstractTable.java:3037)
at com.haulmont.cuba.gui.data.impl.WeakCollectionChangeListener.collectionChanged(WeakCollectionChangeListener.java:41)
at com.haulmont.bali.events.EventRouter.fireEvent(EventRouter.java:45)
at com.haulmont.cuba.gui.data.impl.AbstractCollectionDatasource.fireCollectionChanged(AbstractCollectionDatasource.java:373)
at com.haulmont.cuba.gui.data.impl.CollectionDatasourceImpl.afterRefresh(CollectionDatasourceImpl.java:198)
at com.haulmont.cuba.gui.data.impl.CollectionDatasourceImpl.refresh(CollectionDatasourceImpl.java:163)
at com.haulmont.cuba.gui.data.impl.CollectionDatasourceImpl.refresh(CollectionDatasourceImpl.java:119)
at com.haulmont.cuba.gui.data.impl.GroupDatasourceImpl.setSuspended(GroupDatasourceImpl.java:191)
at com.haulmont.cuba.gui.data.impl.DsContextImpl.resumeSuspended(DsContextImpl.java:84)
at com.haulmont.cuba.gui.WindowManager.afterShowWindow(WindowManager.java:1159)
at com.haulmont.cuba.web.WebWindowManager.showWindow(WebWindowManager.java:422)
at com.haulmont.cuba.web.WebWindowManager.lambda$showWindow$1(WebWindowManager.java:382)
at com.haulmont.cuba.web.gui.WebWindow.close(WebWindow.java:1201)
at com.haulmont.cuba.web.gui.WebWindow.closeAndRun(WebWindow.java:1110)
at com.haulmont.cuba.gui.components.AbstractWindow.closeAndRun(AbstractWindow.java:306)
at com.haulmont.cuba.web.WebWindowManager.showWindow(WebWindowManager.java:381)
at com.haulmont.cuba.gui.WindowManager.openWindow(WindowManager.java:756)
at com.haulmont.cuba.web.WebWindowManager.openWindow(WebWindowManager.java:158)
at com.haulmont.cuba.gui.config.MenuCommand$ScreenCommand.run(MenuCommand.java:181)
at com.haulmont.cuba.gui.config.MenuCommand.execute(MenuCommand.java:76)
at com.haulmont.cuba.web.sys.SideMenuBuilder.lambda$createMenuCommandExecutor$0(SideMenuBuilder.java:180)
at com.haulmont.cuba.web.gui.components.mainwindow.WebSideMenu$MenuItemImpl.lambda$setCommand$0(WebSideMenu.java:471)
at com.haulmont.cuba.web.toolkit.ui.CubaSideMenu$1.menuItemTriggered(CubaSideMenu.java:83)
at sun.reflect.GeneratedMethodAccessor366.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:158)
at com.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:119)
at com.vaadin.server.communication.ServerRpcHandler.handleInvocation(ServerRpcHandler.java:444)
at com.vaadin.server.communication.ServerRpcHandler.handleInvocations(ServerRpcHandler.java:409)
at com.vaadin.server.communication.ServerRpcHandler.handleRpc(ServerRpcHandler.java:274)
at com.vaadin.server.communication.UidlRequestHandler.synchronizedHandleRequest(UidlRequestHandler.java:90)
at com.vaadin.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:41)
at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1435)
at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:361)
at com.haulmont.cuba.web.sys.CubaApplicationServlet.serviceAppRequest(CubaApplicationServlet.java:300)
at com.haulmont.cuba.web.sys.CubaApplicationServlet.service(CubaApplicationServlet.java:191)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.CompositeFilter$VirtualFilterChain.doFilter(CompositeFilter.java:107)
at org.springframework.web.filter.CompositeFilter.doFilter(CompositeFilter.java:73)
at com.haulmont.cuba.web.sys.CubaHttpFilter.doFilter(CubaHttpFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)

Forgive me. Mixed Join rules.