I create services bean in appconfig file. How create this beans with FactoryBean or other way to don't create it one by one?
@SpringBootApplication(exclude = {SecurityAutoConfiguration.class })
@ComponentScan
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
@Bean
public SimpleService<Work> workService() { return new SimpleServiceImpl<Work>() { }; }
@Bean
public SimpleService<User> userService() { return new SimpleServiceImpl<User>() { }; }
@Bean
public SimpleService<Author> authorService() { return new SimpleServiceImpl<Author>() { }; }
@Bean
public SimpleService<Genre> genreService() { return new SimpleServiceImpl<Genre>() { }; }
@Bean
public SimpleService<BookCondition> bookConditionService() { return new SimpleServiceImpl<BookCondition>() { }; }
@Bean
public SimpleService<BookType> bookTypeService() { return new SimpleServiceImpl<BookType>() { }; }
@Bean
public SimpleService<Offer> offerService() { return new SimpleServiceImpl<Offer>() { }; }
Except this services I have only genericService and genericsSrviseImpl.