public static void main(String[] args) throws Exception {

		ApplicationContext context = new ClassPathXmlApplicationContext(
				"spring-module.xml");

		
		
		/* ------- --------------------user -----------------------*/
		
		UserService userservice= (UserService) context.getBean("userServiceBean");
		System.out.println("-------- --- USER --- ---------");
		User user=userservice.findUserByEmailPassword("martinpucheu@udec.cl","cresposexy");
		System.out.println("El usuario encontrado tiene como apellido: "+user.getlastName());
		
		
		
		
		/* ------- --------------------movie -----------------------*/
		
		MovieService movieService = (MovieService) context
				.getBean("movieServiceBean");
		Movie m = new Movie("American Hustle",2013,"Película de esta estafadores","David O. Russell");
		movieService.insert(m);
		System.out.println("-------- --- MOVIES --- ---------");
		Movie _movie = movieService.findMovieById(3);
		System.out.println("La película encontrada es: " + _movie.getName());
		System.out.println(" -.-.-.-");
		List<Movie> _movie2 = movieService.findMovieByTitle("Twilight");
		for(int i=0; i<_movie2.size();i++){
			System.out.println("Econtre la película que buscabas, es: "+_movie2.get(i).getName()+" verdad?");
		}
			
		
		
		
		/* -----------------------------actor----------------------------------- */
		ActorService actorService = (ActorService) context
				.getBean("actorServiceBean");
		//Actor ac=new Actor("Christian","bale");
		//actorService.insert(ac);
		System.out.println("-------- --- ACTOR --- ---------");
		Actor _actor = actorService.findActorById(1);
		System.out.println("El actor encontrado es: " + _actor.getName() + " "
				+ _actor.getLName());

		/*---------acts----------------- */

		ActorService actsService = (ActorService) context
				.getBean("actsServiceBean");
		//Acts a=new Acts(6,4);
		//actsService.insert(a);
		System.out.println("-------- --- ACTS --- ---------");
		List<Acts> _acts = actsService.findActsByMoiveId(1);
		for (int i = 0; i < _acts.size(); i++)
			System.out.println("En la película de id:1 actua el actor con id:["
					+ _acts.get(i).getIda() + "]");

		/*---------Category*/
		MovieService categoryService = (MovieService) context
				.getBean("categoryServiceBean");
		//Category c=new Category("Humor");
		//categoryService.insert(c);
		System.out.println("-------- --- CATEGORY --- ---------");
		Category _category = categoryService.findCategoryByGenre("Thriller");
		System.out.println("La categoria encontrada fue: "
				+ _category.getGenre());

		/*---------DoesLike --- */
		UserService doeslikeService = (UserService) context
				.getBean("doeslikeServiceBean");
		//DoesLike dl=new DoesLike(1,"Suspenso");
		//doeslikeService.insert(dl);
		System.out.println("-------- --- DOESLIKE--- ---------");
		List<DoesLike> _doeslike = doeslikeService.findDoesLikeById(1);
		for (int i = 0; i < _doeslike.size(); i++)
			System.out.println("Al usuario 1 le gusta el genero: "
					+ _doeslike.get(i).getGenre());

		/*---------DoesNotLike --- */
		UserService doesnotlikeService = (UserService) context
				.getBean("doesnotlikeServiceBean");
		//DoesNotLike dnl=new DoesNotLike(1,"Horror");
		//doesnotlikeService.insert(dnl);
		System.out.println("-------- --- DOESNOTLIKE--- ---------");
		List<DoesNotLike> _doesnotlike = doesnotlikeService
				.findDoesNotLikeById(1);
		for (int i = 0; i < _doesnotlike.size(); i++)
			System.out.println("Al usuario 1 no le gusta el genero: "
					+ _doesnotlike.get(i).getGenre());

		/*---------Idiom---------*/
		MovieService idiomService = (MovieService) context
				.getBean("idiomServiceBean");
		//Idiom idi=new Idiom("Coreano");
		//idiomService.insert(idi);
		System.out.println("-------- --- IDIOM --- ---------");
		Idiom _idiom = idiomService.findIdiomByLanguage("Espanol");
		System.out.println("El idioma encontrado es: " + _idiom.getLanguage());

		/*-------idiomp----*/
		UserService idiompService = (UserService) context
				.getBean("idiompServiceBean");
		//Idiomp ip=new Idiomp(1,"Frances");
		//idiompService.insert(ip);
		System.out.println("-------- --- IDIOMP --- ---------");
		List<Idiomp> _idiomp = idiompService.findByUserId(3);
		for (int i = 0; i < _idiomp.size(); i++)
			System.out
					.println("Al usuario 3 le gustan las peliculas en idioma: "
							+ _idiomp.get(i).getLanguage());

		/*------moviecategory----*/
		MovieService moviecategoryService = (MovieService) context
				.getBean("moviecategoryServiceBean");
		System.out.println("-------- --- MOVIECATEGORY --- ---------");
	//	MovieCategory mc=new MovieCategory(3,"Infantil");
	//	moviecategoryService.insert(mc);
		List<MovieCategory> _moviecategory = moviecategoryService.findMoviesByGendre("Thriller");
		for (int i = 0; i < _moviecategory.size(); i++)
			System.out.println("Los ID de las películas del genero Thriller son: "+_moviecategory.get(i).getIdp());
		

		/*-----rating -----*/
		MovieService ratingService = (MovieService) context
				.getBean("ratingServiceBean");
		//Rating _rating2=new Rating(2,7,5);
		//ratingService.insert(_rating2);
		System.out.println("-------- --- RATING --- ---------");
		Rating _rating = ratingService.findRatingById(1, 1);
		System.out
				.println("La calificación que le dio el usuario 2 a la película 3 es: ["
						+ _rating.getMark() + "]");

		/*----------------------------speak ------------------------------- */
		MovieService speakService = (MovieService) context
				.getBean("speakServiceBean");
		Speak _speak2=new Speak(2,"Frances");
		//speakService.insert(_speak2);
		System.out.println("-------- --- SPEAK --- ---------");
		Speak _speak = speakService.findSpeakByIdp(4);
		System.out.println("EL idioma de la película 4 es: "
				+ _speak.getLengua());

		/*-----wish----*/
		
		UserService wishlistService = (UserService) context
				.getBean("wishlistServiceBean");

		WishList wishlist=new WishList(5,1);
		//wishlistService.insert(wishlist);
		System.out.println("-------- --- WISHLIST --- ---------");		
		List<WishList> _wishlist = wishlistService.findWishListById(1);
		
		for (int i = 0; i < _wishlist.size(); i++)
			System.out.println("La película con id:"+ _wishlist.get(i).getIdp()+" está en la Wishlist del usuario 1 ");
		

	}