package demo.repository;
import java.util.List;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import core.Person;
import core.PersonRepository;
public class JdbcDemo {
public static void main(String[] args) {
ApplicationContext context = new ClassPathXmlApplicationContext("config.xml", JdbcDemo.class);
PersonRepository personRepository = context.getBean(PersonRepository.class);
System.out.println("There are currently " + personRepository.count() + " people in the DB:");
List<Person> people = personRepository.getAll();
for (Person person : people) {
System.out.println(person);
}
}
}