Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Configuration
- @ComponentScan({ "myproject" })
- @EnableAutoConfiguration
- @EnableNeo4jRepositories(basePackages = "myproject")
- public class Server extends Neo4jConfiguration implements CommandLineRunner
- {
- public Server()
- {
- setBasePackage("myproject");
- }
- @Bean
- SpringRestGraphDatabase graphDatabaseService()
- {
- return new SpringRestGraphDatabase("http://localhost:7474/db/data");
- }
- @Bean
- Mapper mapper()
- {
- return new DozerBeanMapper();
- }
- public void run(String... args) throws Exception
- {
- }
- public static void main(String[] args) throws Exception
- {
- SpringApplication.run(Server.class, args);
- }
- }
- @Component
- public class MyService
- {
- @Autowired
- private Mapper mapper; //Fails to autowire org.dozer.Mapper
- .....
- }
- @RestController
- @RequestMapping("/rest")
- public class CustomerController
- {
- @Autowired
- private Mapper mapper; //autowire sucess org.dozer.Mapper
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement