I want to populate table/grid from external java class, so I have tried the programatic creation of ds:
CollectionDatasource ds = new DsBuilder(getDsContext())
.setJavaClass(externaljava.class)
.setViewName(View.LOCAL)
.setId("someDs")
.buildCollectionDatasource();
but it throws an exception at the buildCollectionDatasource.
I have also tried to populate the table from external service as discussed in this topic but the KeyValueCollectionDatasourceImpl class is not defined in my project.
All I want is to get rid of the cuba side generated queries to the external service architecture.
Regarding you question, please be more specific and provide an exception stack trace. Also, DsBuilder now has special methods for creating KeyValueDatasources, e.g. buildValuesCollectionDatasource().
In a datasource, you can use only entities defined in the data model of your project. If you want to display data from external system, create an appropriate non-persistent entity, or use KeyValueEntity with ValueDatasource.