Java Code Examples for org.springframework.boot.SpringApplication#setLazyInitialization()
The following examples show how to use
org.springframework.boot.SpringApplication#setLazyInitialization() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SimpleQuery.java From micronaut-data with Apache License 2.0 | 6 votes |
@Setup public void prepare() { SpringApplication springApplication = new SpringApplication(); springApplication.addPrimarySources(Collections.singletonList(Application.class)); springApplication.setLazyInitialization(true); applicationContext = springApplication.run(); this.bookRepository = applicationContext.getBean(BookRepository.class); this.bookRepository.saveAll(Arrays.asList( new Book("The Stand", 1000), new Book("The Shining", 600), new Book("The Power of the Dog", 500), new Book("The Border", 700), new Book("Along Came a Spider", 300), new Book("Pet Cemetery", 400), new Book("A Game of Thrones", 900), new Book("A Clash of Kings", 1100) )); }
Example 2
Source File: MongoDbFixture.java From spring-data-dev-tools with Apache License 2.0 | 6 votes |
MongoDbFixture() { SpringApplication application = new SpringApplication(); application.addPrimarySources(Collections.singletonList(MongoDbApplication.class)); application.setAdditionalProfiles("jpa"); application.setLazyInitialization(true); this.context = application.run(); MongoOperations operations = context.getBean(MongoOperations.class); operations.dropCollection(Book.class); IntStream.range(0, Constants.NUMBER_OF_BOOKS) // .mapToObj(it -> new Book("title" + it, it)) // .forEach(operations::save); }
Example 3
Source File: Benchmarks.java From sdn-rx with Apache License 2.0 | 5 votes |
@Setup public void setup() { Map<String, Object> neo4jConfig = prepareNeo4j(); SpringApplication springApplication = new SpringApplication(); springApplication.addPrimarySources(Collections.singletonList(Application.class)); springApplication.setLazyInitialization(true); springApplication.setDefaultProperties(neo4jConfig); this.applicationContext = springApplication.run(); this.movieRepository = applicationContext.getBean(MovieRepository.class); this.driver = applicationContext.getBean(Driver.class); }
Example 4
Source File: Benchmarks.java From sdn-rx with Apache License 2.0 | 5 votes |
@Setup public void setup() { Map<String, Object> neo4jConfig = prepareNeo4j(); SpringApplication springApplication = new SpringApplication(); springApplication.addPrimarySources(Collections.singletonList(Application.class)); springApplication.setLazyInitialization(true); springApplication.setDefaultProperties(neo4jConfig); this.applicationContext = springApplication.run(); this.movieRepository = applicationContext.getBean(MovieRepository.class); this.driver = applicationContext.getBean(Driver.class); }
Example 5
Source File: Benchmarks.java From sdn-rx with Apache License 2.0 | 5 votes |
@Setup public void setup() { Map<String, Object> neo4jConfig = prepareNeo4j(); SpringApplication springApplication = new SpringApplication(); springApplication.addPrimarySources(Collections.singletonList(Application.class)); springApplication.setLazyInitialization(true); springApplication.setDefaultProperties(neo4jConfig); this.applicationContext = springApplication.run(); this.movieRepository = applicationContext.getBean(MovieRepository.class); this.driver = applicationContext.getBean(Driver.class); }
Example 6
Source File: Benchmarks.java From sdn-rx with Apache License 2.0 | 5 votes |
@Setup public void setup() { Map<String, Object> neo4jConfig = prepareNeo4j(); SpringApplication springApplication = new SpringApplication(); springApplication.addPrimarySources(Collections.singletonList(Application.class)); springApplication.setLazyInitialization(true); springApplication.setDefaultProperties(neo4jConfig); this.applicationContext = springApplication.run(); this.movieRepository = applicationContext.getBean(MovieRepository.class); this.driver = applicationContext.getBean(SessionFactory.class).unwrap(Driver.class); }
Example 7
Source File: SimpleQuery.java From micronaut-data with Apache License 2.0 | 5 votes |
@Setup public void prepare() { SpringApplication springApplication = new SpringApplication(); springApplication.addPrimarySources(Collections.singletonList(Application.class)); springApplication.setLazyInitialization(true); applicationContext = springApplication.run(); this.bookRepository = applicationContext.getBean(BookRepository.class); this.bookRepository.saveAll(Arrays.asList(new Book("The Stand", 1000), new Book("The Shining", 600), new Book("The Power of the Dog", 500), new Book("The Border", 700), new Book("Along Came a Spider", 300), new Book("Pet Cemetery", 400), new Book("A Game of Thrones", 900), new Book("A Clash of Kings", 1100))); }
Example 8
Source File: FixtureUtils.java From spring-data-dev-tools with Apache License 2.0 | 5 votes |
public static ConfigurableApplicationContext createContext(Class<?> configuration, String api, String database) { SpringApplication application = new SpringApplication(); application.addPrimarySources(Collections.singletonList(configuration)); application.setLazyInitialization(true); application.setAdditionalProfiles(api, database); System.out.println("Activating profiles: " + Arrays.asList(api, database).toString()); return application.run(); }