@Test(expected = ODataDataSourceException.class) public void testGetDataSourceNotExisting() throws ODataDataSourceException { assertThat(dataSourceFactory.getDataSource(oDataRequestContext, "ODataDemo.Product"), is(dataSourceMock)); }
@Override public DataSource getDataSource(ODataRequestContext requestContext, final String entityType) throws ODataDataSourceException { for (DataSourceProvider dataSourceProvider : dataSourceProviders) { if (dataSourceProvider.isSuitableFor(requestContext, entityType)) { return dataSourceProvider.getDataSource(requestContext); } } LOG.error("No data source provider found for entity type '{}'", entityType); throw new ODataDataSourceException("No data source provider found for entity type '" + entityType + "'"); }
DataSourceFactoryImpl implements DataSourceFactory { @Override public DataSource getDataSource(ODataRequestContext requestContext, final String entityType) throws ODataDataSourceException { for (DataSourceProvider dataSourceProvider : dataSourceProviders) { if (dataSourceProvider.isSuitableFor(requestContext, entityType)) { return dataSourceProvider.getDataSource(requestContext); } } LOG.error("No data source provider found for entity type '{}'", entityType); throw new ODataDataSourceException("No data source provider found for entity type '" + entityType + "'"); } }
DataSourceFactoryImpl implements DataSourceFactory { @Override public DataSource getDataSource(ODataRequestContext requestContext, final String entityType) throws ODataDataSourceException { for (DataSourceProvider dataSourceProvider : dataSourceProviders) { if (dataSourceProvider.isSuitableFor(requestContext, entityType)) { return dataSourceProvider.getDataSource(requestContext); } } LOG.error("No data source provider found for entity type '{}'", entityType); throw new ODataDataSourceException("No data source provider found for entity type '" + entityType + "'"); }  }
DataSourceFactoryImpl implements DataSourceFactory { @Override public DataSource getDataSource(ODataRequestContext requestContext, final String entityType) throws ODataDataSourceException { for (DataSourceProvider dataSourceProvider : dataSourceProviders) { if (dataSourceProvider.isSuitableFor(requestContext, entityType)) { return dataSourceProvider.getDataSource(requestContext); } } LOG.error("No data source provider found for entity type '{}'", entityType); throw new ODataDataSourceException("No data source provider found for entity type '" + entityType + "'"); }  @Override DataSource getDataSource(ODataRequestContext requestContext,
                                    final String entityType); @Override QueryOperationStrategy getStrategy(ODataRequestContext requestContext, QueryOperation operation,
                                              TargetType expectedODataEntityType); }
DataSourceFactoryImpl implements DataSourceFactory { @Override public DataSource getDataSource(ODataRequestContext requestContext, final String entityType) throws ODataDataSourceException { for (DataSourceProvider dataSourceProvider : dataSourceProviders) { if (dataSourceProvider.isSuitableFor(requestContext, entityType)) { return dataSourceProvider.getDataSource(requestContext); } } LOG.error("No data source provider found for entity type '{}'", entityType); throw new ODataDataSourceException("No data source provider found for entity type '" + entityType + "'"); }  @Override DataSource getDataSource(ODataRequestContext requestContext,
                                    final String entityType); @Override QueryOperationStrategy getStrategy(ODataRequestContext requestContext, QueryOperation operation,
                                              TargetType expectedODataEntityType);  }