Movie movie = PrototypeQueries.getMovie(pm, movieTitle);
if( movie == null ){
System.err.print("Could not access movie with title of ");
System.err.println(movieTitle);
return;
}
Set cast = movie.getCast();
Iterator iter = cast.iterator();
while( iter.hasNext() ){
Role role = (Role) iter.next();
Actor actor = role.getActor();
actor.removeRole(role);
}
pm.deletePersistentAll(cast);
pm.deletePersistent(movie);