/** * The method provides the functionality to retrieve all the repositories and initialize them * @see Repository */ protected void initializeRepository(){ final Map<String, Object> repositories = applicationContext.getBeansWithAnnotation(org.springframework.stereotype.Repository.class); for(Map.Entry<String, Object> entry : repositories.entrySet()){ final Object value = entry.getValue(); if(value instanceof Repository){ final Repository repository = (Repository) value; repository.initialize(); } } }