mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-09-20 03:16:42 +00:00
Change ModuleInfoLoader API and querybean-generator for named default database (#2190)
Currently we can not use @DbName with the entities of the default database. With this change the generated code that registers entity classes will support using @DbName with the default database.
This commit is contained in:
@@ -135,16 +135,11 @@ public class DefaultContainer implements SpiContainer {
|
||||
configProvider.apply((ServerConfig)config);
|
||||
}
|
||||
}
|
||||
if (config.isAutoLoadModuleInfo()) {
|
||||
// auto register entity classes (default db)
|
||||
for (ModuleInfoLoader loader : ServiceLoader.load(ModuleInfoLoader.class)) {
|
||||
config.addAll(loader.entityClasses());
|
||||
}
|
||||
}
|
||||
} else if (config.isAutoLoadModuleInfo()) {
|
||||
// auto register entity classes (other named db)
|
||||
}
|
||||
if (config.isAutoLoadModuleInfo()) {
|
||||
// auto register entity classes
|
||||
for (ModuleInfoLoader loader : ServiceLoader.load(ModuleInfoLoader.class)) {
|
||||
config.addAll(loader.entityClassesFor(config.getName()));
|
||||
config.addAll(loader.classesFor(config.getName(), config.isDefaultServer()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user