Skip to content

Commit

Permalink
Commit to branch - test
Browse files Browse the repository at this point in the history
  • Loading branch information
michael52 committed Oct 18, 2017
1 parent 8725b3b commit 8e02587
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main/java/pl/examples/SpringAOPApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import pl.examples.model.Book;
import pl.examples.service.BookRepository;
import pl.examples.service.GenericRepository;

import java.lang.reflect.GenericArrayType;
Expand All @@ -15,18 +16,18 @@

@Configuration
@ComponentScan
@EnableAspectJAutoProxy
@EnableAspectJAutoProxy(proxyTargetClass=true)
public class SpringAOPApplication {
public static void main(String[] args) {

AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(SpringAOPApplication.class);

GenericRepository<String, Book> repo = ctx.getBean(GenericRepository.class);
BookRepository repo = ctx.getBean(BookRepository.class);
repo.add(new Book("1-123-123-123", "Książka pierwsza", "Autor pierwszej książki"));
repo.add(new Book("2-234-234-234", "Książka druga", "Autor drugiej książki"));
repo.add(new Book("3-345-345-345", "Książka trzecia", "Autor trzeciej książki"));

Book bookData = repo.get("2-234-234-234");
Book bookData = repo.get("3-345-345-345");
System.out.println(bookData);

ctx.close();
Expand Down

0 comments on commit 8e02587

Please sign in to comment.