@ComponentScan(basePackageClasses = {ExampleController.class, ExampleModel.class, ExmapleView.class})
@ComponentScan(basePackages = {
"com.javarticles.spring.annotations.packageA",
"com.javarticles.spring.annotations.packageB",
"com.javarticles.spring.annotations.packageE" }, basePackageClasses = BeanC1.class)
public class BookDAO {
List
{
Book book1 = new Book(1, "Ramayana",5,4);
Book book2 = new Book(2, "Mahabharat",6,3);
bookList.add(book1);
bookList.add(book2);
}
public Book getBook(int id) {
//In real time, use database to fetch data
return bookList.get(id);
}
}
No comments:
Post a Comment