You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I set the map-sub-package option as true as follows:
MapperOptions mapperOptions = new MapperOptions();
mapperOptions.setMapSubPackages(true);
final Morphia morphia = new Morphia(new Mapper(mapperOptions));
morphia.mapPackage("com.package.name");
But it could only find classes in one package layer.
And i find the reason is the getFielNames in ReflectionUtils:
private static Set<String> getFileNames(final File directory, final String packageName, final boolean mapSubPackages) {
Set<String> fileNames = new HashSet<String>();
for (File file: directory.listFiles()) {
if (file.isFile()) {
fileNames.add(packageName + '.' + file.getName());
} else if (mapSubPackages){
fileNames.addAll(getFileNames(file, packageName + '.' + file.getName(), false));
}
}
return fileNames;
}
it seems a bug appeared. or for some other considerations?
The text was updated successfully, but these errors were encountered:
Could you test with the 1.2.0-SNAPSHOT-Version of morphia, if your
problem still exists?
Am 20.04.16 um 12:07 schrieb Tony Yang:
I set the map-sub-package option as true as follows:
|MapperOptions mapperOptions = new MapperOptions();
mapperOptions.setMapSubPackages(true);
final Morphia morphia = new Morphia(new Mapper(mapperOptions));
morphia.mapPackage("com.package.name");|
But it could only reflect one package layer.
And i find the reason is the getFielNames in ReflectionUtils:
|private static Set getFileNames(final File directory, final
String packageName, final boolean mapSubPackages) {
Set fileNames = new HashSet();
for (File file: directory.listFiles()) {
if (file.isFile()) {
fileNames.add(packageName + '.' + file.getName());
} else if (mapSubPackages){
fileNames.addAll(getFileNames(file, packageName + '.' +
file.getName(), false));
}
}
return fileNames;
}|
it seems a bug appeared. or for some other considerations?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub #924
Not exactly. fileNames.addAll(getFileNames(file, packageName + '.' + file.getName(), false));
I think the 'false' should be 'mapSubPackages' instead. the recursive invocation is not exact.
I set the map-sub-package option as true as follows:
But it could only find classes in one package layer.
And i find the reason is the getFielNames in ReflectionUtils:
it seems a bug appeared. or for some other considerations?
The text was updated successfully, but these errors were encountered: