@Override public Dao dao(Class<?> modelClass) { Dao dao = modelDaoMap.get(modelClass); if (null == dao) { String svcId = dbId(modelClass); DbService dbService = dbService(svcId); dao = dbService.defaultDao(modelClass); modelDaoMap.put(modelClass, dao); } return dao; }
private void prepareAsyncInitializers() { for (Map.Entry<String, DbService> entry : serviceMap.entrySet()) { DbService service = entry.getValue(); if (service.initAsynchronously()) { asyncInitializers.put(service, service); } } }
void explore(App app) { DbServiceManager mgr = app.dbServiceManager(); MasterEntityMetaInfoRepo repo = app.entityMetaInfoRepo(); for (DbService svc: mgr.registeredServices()) { String dbId = svc.id(); EntityMetaInfoRepo repo0 = repo.forDb(dbId); if (null != repo0 && svc instanceof JPAService) { lookupIn((JPAService) svc, repo0); } } }
List<Dao> toBeDeleted = new ArrayList<>(); for (DbService svc : dbServiceManager.registeredServices()) { for (Class entityClass : svc.entityClasses()) { try { toBeDeleted.add(dbServiceManager.dao(entityClass));
/** * Returns all model classes registered on this datasource * * @return model classes talk to this datasource */ public Set<Class> entityClasses() { EntityMetaInfoRepo repo = app().entityMetaInfoRepo().forDb(id); return null == repo ? C.<Class>set() : repo.entityClasses(); }
@Override public AnnotationVisitor visitAnnotation(String desc, boolean visible) { if (isModel) { Type type = Type.getType(desc); for (DbService dbService : dbm().registeredServices()) { if (type.equals(Type.getType(dbService.entityAnnotationType()))) { isEntityClass = true; } } } return super.visitAnnotation(desc, visible); }
DbService svc = serviceMap.values().iterator().next(); serviceMap.put(DEFAULT, svc); logger.warn("db service configuration not found. Use the sole one db service[%s] as default service", svc.id()); } else { if (serviceMap.isEmpty()) {
List<Dao> toBeDeleted = new ArrayList<>(); for (DbService svc : dbServiceManager.registeredServices()) { for (Class entityClass : svc.entityClasses()) { try { toBeDeleted.add(dbServiceManager.dao(entityClass));
/** * Returns all model classes registered on this datasource * * @return model classes talk to this datasource */ public Set<Class> entityClasses() { EntityMetaInfoRepo repo = app().entityMetaInfoRepo().forDb(id); return null == repo ? C.<Class>set() : repo.entityClasses(); }
@Override public AnnotationVisitor visitAnnotation(String desc, boolean visible) { if (isModel) { Type type = Type.getType(desc); for (DbService dbService : dbm().registeredServices()) { if (type.equals(Type.getType(dbService.entityAnnotationType()))) { isEntityClass = true; } } } return super.visitAnnotation(desc, visible); }
DbService svc = serviceMap.values().iterator().next(); serviceMap.put(DEFAULT, svc); logger.warn("db service configuration not found. Use the sole one db service[%s] as default service", svc.id()); } else { if (serviceMap.isEmpty()) {
List<Dao> toBeDeleted = new ArrayList<>(); for (DbService svc : dbServiceManager.registeredServices()) { for (Class entityClass : svc.entityClasses()) { try { toBeDeleted.add(dbServiceManager.dao(entityClass));
@Override public Dao dao(Class<?> modelClass) { Dao dao = modelDaoMap.get(modelClass); if (null == dao) { String svcId = dbId(modelClass); DbService dbService = dbService(svcId); dao = dbService.defaultDao(modelClass); modelDaoMap.put(modelClass, dao); } return dao; }
private void prepareAsyncInitializers() { for (Map.Entry<String, DbService> entry : serviceMap.entrySet()) { DbService service = entry.getValue(); if (service.initAsynchronously()) { asyncInitializers.put(service, service); } } }
ClassInfoRepository classInfoRepository = app.classLoader().classInfoRepository(); for (DbService db : app.dbServiceManager().registeredServices()) { final EntityMetaInfoRepo repo = masterRepo.forDb(db.id()); final Set<Class> entityClasses = new HashSet<>(repo.entityClasses()); for (Class entityClass : repo.entityClasses()) {
ClassInfoRepository classInfoRepository = app.classLoader().classInfoRepository(); for (DbService db : app.dbServiceManager().registeredServices()) { final EntityMetaInfoRepo repo = masterRepo.forDb(db.id()); final Set<Class> entityClasses = new HashSet<>(repo.entityClasses()); for (Class entityClass : repo.entityClasses()) {