Skip to content

Commit

Permalink
optimize method that find and implement custom repository interface
Browse files Browse the repository at this point in the history
  • Loading branch information
kswapd committed Jul 5, 2018
1 parent c0d9d71 commit 1bf0592
Showing 1 changed file with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ protected boolean match(ClassMetadata metadata) {

boolean isMatch = false;
String repoName = ClassUtils.getShortName(this.dbClass.getName());
Class<?> p = null;
/*Class<?> p = null;
try {
p = Class.forName(metadata.getClassName());
}
catch (ClassNotFoundException e) {
Expand All @@ -47,7 +48,22 @@ protected boolean match(ClassMetadata metadata) {
break;
}
}
}*/

if(metadata.isInterface()){
String[] interfaceNames = metadata.getInterfaceNames();
if(interfaceNames != null && interfaceNames.length > 0){
for(String interfaceName:interfaceNames){
if(interfaceName.contains(repoName)){
isMatch = true;
break;
}
}
}
}



return isMatch;

}
Expand Down

0 comments on commit 1bf0592

Please sign in to comment.