Skip to content

Commit

Permalink
Merge pull request #309 from CorvusYe/master
Browse files Browse the repository at this point in the history
fix: allow normal startup without any mapper files.
  • Loading branch information
CorvusYe authored Jul 29, 2024
2 parents 7c4214f + 8a5623c commit 836b58b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ This source code is licensed under Apache 2.0 License.

- fix: when `use-session-pool` and spaceFromParam is true, skip the space addition.
- fix: when timezone is not default, the time is incorrect.
- fix: allow normal startup without any mapper files.

## Feature

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import static org.nebula.contrib.ngbatis.utils.ReflectUtil.NEED_SEALING_TYPES;
import static org.nebula.contrib.ngbatis.utils.ReflectUtil.getNameUniqueMethod;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
Expand Down Expand Up @@ -79,11 +80,14 @@ public MapperResourceLoader(ParseCfgProps parseConfig) {
@TimeLog(name = "xml-load", explain = "mappers xml load completed : {} ms")
public Map<String, ClassModel> load() {
Map<String, ClassModel> resultClassModel = new HashMap<>();
String mapperLocations = parseConfig.getMapperLocations();
try {
Resource[] resources = getResources(parseConfig.getMapperLocations());
Resource[] resources = getResources(mapperLocations);
for (Resource resource : resources) {
resultClassModel.putAll(parseClassModel(resource));
}
} catch (FileNotFoundException ffe) {
log.warn("No mapper files were found in path pattern '{}', please add", mapperLocations);
} catch (IOException | NoSuchMethodException e) {
throw new ResourceLoadException(e);
}
Expand Down

0 comments on commit 836b58b

Please sign in to comment.