Skip to content

Commit

Permalink
#2242 fix proxy casting error with MetadataSource
Browse files Browse the repository at this point in the history
  • Loading branch information
ufoscw committed Jul 1, 2019
1 parent 14db6d3 commit e890360
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,23 @@ public List<MetadataSource> findMetadataSourcesBySourceId(String type, String so
* @return
*/
public Object getSourcesBySourceId(Metadata.SourceType type, String sourceId) {
switch (type) {
case ENGINE:
return dataSourceRepository.findOne(sourceId);
case JDBC:
return dataConnectionRepository.findOne(sourceId);
}
return null;
}

/**
* Gets sources by source id with projection.
*
* @param type the type
* @param sourceId the source id
* @return the sources by source id with projection
*/
public Object getSourcesBySourceIdWithProjection(Metadata.SourceType type, String sourceId) {
Object source = null;
switch (type) {
case ENGINE:
Expand All @@ -74,7 +91,6 @@ public Object getSourcesBySourceId(Metadata.SourceType type, String sourceId) {
source = dataConnectionRepository.findOne(sourceId);
break;
}

return source;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public interface ForDetailViewProjection {

//String getSourceId();

@Value("#{@metaSourceService.getSourcesBySourceId(target.type, target.sourceId)}")
@Value("#{@metaSourceService.getSourcesBySourceIdWithProjection(target.type, target.sourceId)}")
Object getSource();

String getSchema();
Expand Down

0 comments on commit e890360

Please sign in to comment.