Parameters with datasource custom implementation classes

Hi, I would like to read from a database that is not the main (datastore) table, the problem is that I have to compose the table name dynamically, for this I have created a datasource custom implementation classes since in the documentation I read That the getEntities method can receive a map with parameters. The parameter to be passed to this custom datasource is obtained from a component (lookupField). The idea I have is to inject the custom datasource into the screen controller and to override the init method in order to do a dataurce.refresh (Map <String, Object>), this is throwing me an error. Attached image of custom datasource, studio screen and error:

Field was not created class _Dummy_ {private com.albertosancheznieto.totem.web.plancontable.planContableDatasource.class planContablesDs; }
Com.intellij.util.IncorrectOperationException: Field was not created class _Dummy_ {private com.albertosancheznieto.totem.web.plancontable.planContableDatasource.class planContablesDs; }
At com.intellij.psi.impl.PsiElementFactoryImpl.createField (PsiElementFactoryImpl.java:233)
At com.haulmont.tools.ag.action.insight.GenerateInjectsHandler.addInitialization (GenerateInjectsHandler.java:120)
At com.haulmont.tools.ag.action.insight.GenerateInjectsHandler.generateMemberPrototypes (GenerateInjectsHandler.java:108)
At com.haulmont.tools.ag.action.insight.GenerateInjectsHandler.doGenerate (GenerateInjectsHandler.java:79)
At com.haulmont.tools.ag.action.insight.GenerateInjectsHandler $ 1.run (GenerateInjectsHandler.java:69)
At com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction (ApplicationImpl.java:1023)
At com.haulmont.tools.ag.action.insight.GenerateInjectsHandler.invoke (GenerateInjectsHandler.java:67)
At com.intellij.codeInsight.actions.CodeInsightAction.lambda $ null $ 0 (CodeInsightAction.java:74)
At com.intellij.codeInsight.actions.CodeInsightAction.lambda $ actionPerformedImpl $ 1 (CodeInsightAction.java:80)
At com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand (CoreCommandProcessor.java:149)
At com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand (CoreCommandProcessor.java:109)
At com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand (CoreCommandProcessor.java:99)
At com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand (CoreCommandProcessor.java:85)
At com.intellij.codeInsight.actions.CodeInsightAction.actionPerformedImpl (CodeInsightAction.java:71)
At com.intellij.codeInsight.actions.CodeInsightAction.actionPerformed (CodeInsightAction.java:44)
At com.intellij.openapi.actionSystem.ex.ActionUtil $ 1.run (ActionUtil.java:215)
At com.intellij.openapi.application.TransactionGuardImpl.runSyncTransaction (TransactionGuardImpl.java:86)
At com.intellij.openapi.application.TransactionGuardImpl.submitTransactionAndWait (TransactionGuardImpl.java:151)
At com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware (ActionUtil.java:230)
At com.intellij.ui.popup.PopupFactoryImpl $ ActionPopupStep.performAction (PopupFactoryImpl.java:968)
At com.intellij.ui.popup.PopupFactoryImpl $ ActionPopupStep.performAction (PopupFactoryImpl.java:958)
At com.intellij.ui.popup.PopupFactoryImpl $ ActionPopupStep.lambda $ onChosen $ 0 (PopupFactoryImpl.java:952)
At com.intellij.openapi.application.TransactionGuardImpl.performUserActivity (TransactionGuardImpl.java:193)
At com.intellij.ui.popup.AbstractPopup.lambda $ null $ 7 (AbstractPopup.java:1396)
At java.awt.event.InvocationEvent.dispatch (InvocationEvent.java:311)
At java.awt.EventQueue.dispatchEventImpl (EventQueue.java:762)
At java.awt.EventQueue.access $ 500 (EventQueue.java:98)
At java.awt.EventQueue $ 3.run (EventQueue.java:715)
At java.awt.EventQueue $ 3.run (EventQueue.java:709)
At java.security.AccessController.doPrivileged (Native Method)
At java.security.ProtectionDomain $ JavaSecurityAccessImpl.doIntersectionPrivilege (ProtectionDomain.java:80)
At java.awt.EventQueue.dispatchEvent (EventQueue.java:732)
At com.intellij.ide.IdeEventQueue.defaultDispatchEvent (IdeEventQueue.java:827)
At com.intellij.ide.IdeEventQueue._dispatchEvent (IdeEventQueue.java:655)
At com.intellij.ide.IdeEventQueue.dispatchEvent (IdeEventQueue.java:365)
At java.awt.EventDispatchThread.pumpOneEventForFilters (EventDispatchThread.java:201)
At java.awt.EventDispatchThread.pumpEventsForFilter (EventDispatchThread.java:116)
At java.awt.EventDispatchThread.pumpEventsForHierarchy (EventDispatchThread.java:105)
At java.awt.EventDispatchThread.pumpEvents (EventDispatchThread.java:101)
At java.awt.EventDispatchThread.pumpEvents (EventDispatchThread.java:93)
At java.awt.EventDispatchThread.run (EventDispatchThread.java:82)

Thanks and regards.

controller-load-customdatasource

custom-datasource

custom-datasource-studio

Hi,

Remove “.class” from the name of you datasource in Studio or right in the XML descriptor. And better name your classes with first capital letter.

Thanks Konstantin.