Created
March 22, 2016 20:13
-
-
Save MafaldaLandeiro/1e78397def4eeeb0e7e2 to your computer and use it in GitHub Desktop.
Main
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package org.CachingDataSpring; | |
| import org.slf4j.Logger; | |
| import org.slf4j.LoggerFactory; | |
| import org.springframework.beans.factory.annotation.Autowired; | |
| import org.springframework.boot.CommandLineRunner; | |
| import org.springframework.boot.SpringApplication; | |
| import org.springframework.boot.autoconfigure.SpringBootApplication; | |
| import org.springframework.cache.annotation.EnableCaching; | |
| @SpringBootApplication | |
| @EnableCaching | |
| public class App implements CommandLineRunner { | |
| private static final Logger log = LoggerFactory.getLogger(App.class); | |
| @Autowired | |
| CountryRepository countryRepository; | |
| public static void main(String[] args) { | |
| SpringApplication.run(App.class); | |
| } | |
| @Override | |
| public void run(String... arg0) throws Exception { | |
| for (int i = 0; i < 5; i++) { | |
| log.info("--- Country found with findByCurrency(EUR) ---"); | |
| for (Country country3 : countryRepository.findByCurrency("EUR")) { | |
| log.info(country3.toString()); | |
| } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment