Advertisement
Guest User

Untitled

a guest
Sep 17th, 2014
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. @Configuration
  2. @ComponentScan({ "myproject" })
  3. @EnableAutoConfiguration
  4. @EnableNeo4jRepositories(basePackages = "myproject")
  5. public class Server extends Neo4jConfiguration implements CommandLineRunner
  6. {
  7.  
  8. public Server()
  9. {
  10. setBasePackage("myproject");
  11. }
  12.  
  13. @Bean
  14. SpringRestGraphDatabase graphDatabaseService()
  15. {
  16. return new SpringRestGraphDatabase("http://localhost:7474/db/data");
  17. }
  18.  
  19. @Bean
  20. Mapper mapper()
  21. {
  22. return new DozerBeanMapper();
  23. }
  24.  
  25. public void run(String... args) throws Exception
  26. {
  27. }
  28.  
  29. public static void main(String[] args) throws Exception
  30. {
  31. SpringApplication.run(Server.class, args);
  32. }
  33.  
  34. }
  35.  
  36. @Component
  37. public class MyService
  38. {
  39.  
  40. @Autowired
  41. private Mapper mapper; //Fails to autowire org.dozer.Mapper
  42.  
  43. .....
  44. }
  45.  
  46. @RestController
  47. @RequestMapping("/rest")
  48. public class CustomerController
  49. {
  50. @Autowired
  51. private Mapper mapper; //autowire sucess org.dozer.Mapper
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement