FileDocCategorySizeDatePackage
PrintMovies.javaAPI DocExample1407Wed Dec 25 16:23:42 GMT 2002com.mediamania.prototype

PrintMovies

public class PrintMovies extends com.mediamania.MediaManiaApp

Fields Summary
Constructors Summary
Methods Summary
public voidexecute()

        Extent extent = pm.getExtent(Movie.class, true);
        Iterator iter = extent.iterator();
        while (iter.hasNext()){
            Movie movie = (Movie) iter.next();
            System.out.print(movie.getTitle());           System.out.print(";");
            System.out.print(movie.getRating());          System.out.print(";");
            System.out.print(movie.formatReleaseDate() ); System.out.print(";");
            System.out.print(movie.getRunningTime());     System.out.print(";");
            System.out.println(movie.getGenres());
            Set cast = movie.getCast();
            Iterator castIterator = cast.iterator();
            while (castIterator.hasNext()) {
                Role role = (Role) castIterator.next();
                System.out.print("\t");
                System.out.print(role.getName());
                System.out.print(", ");
                System.out.println(role.getActor().getName());
            }
        }
        extent.close(iter);
    
public static voidmain(java.lang.String[] args)

        PrintMovies movies = new PrintMovies();
        movies.executeTransaction();