Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
minborg committed Oct 1, 2016
1 parent e11468a commit ac91537
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Expand Up @@ -13,9 +13,7 @@
*/
public interface SqlStreamSupplierComponent extends StreamSupplierComponent {

public interface Support<ENTITY> {

String getSql();
public interface Support<ENTITY> {

ENTITY from(ResultSet rs);

Expand Down
Expand Up @@ -30,20 +30,24 @@
*/
public class SqlStreamSupplierComponentImpl implements SqlStreamSupplierComponent {

private final Map<TableIdentifier, SqlStreamSupplierComponent.Support> supportMap;
private final Map<TableIdentifier, SqlStreamSupplierComponentImpl> supportMap;

public SqlStreamSupplierComponentImpl() {
this.supportMap = new ConcurrentHashMap<>();
}

@Override
public <ENTITY> Stream<ENTITY> stream(TableIdentifier<ENTITY> tableIdentifier, StreamDecorator decorator) {
final SqlStreamSupplierComponent.Support support = supportMap.computeIfAbsent(tableIdentifier, this::makeSupport);
final SqlStreamSupplierComponentImpl support = supportMap.computeIfAbsent(tableIdentifier, this::makeSupport);

return Stream.empty(); // Todo: Generate stream.
}

private SqlStreamSupplierComponent.Support makeSupport(TableIdentifier<?> tableIdentifier) {
private SqlStreamSupplierComponentImpl makeSupport(TableIdentifier<?> tableIdentifier) {

SqlStreamSupplierComponent.Support externalSupport = injector....find()
SqlStreamSupplierComponentImpl support = new SqlStreamSupplierComponentImplSupport(externalSupport);

// Calculate stuff from the TableIdentifier and some other components...
return null;
}
Expand Down

0 comments on commit ac91537

Please sign in to comment.