public void deleteMovie() {
CriteriaBuilder builder = em.getCriteriaBuilder();
CriteriaDelete deleteCriteria = builder.createCriteriaDelete(Movie.class);
Root<Movie> updateRoot = deleteCriteria.from(Movie.class);
deleteCriteria.where(builder.equal(updateRoot.get(Movie_.name), "The Matrix"));
Query q = em.createQuery(deleteCriteria);
q.executeUpdate();
em.flush();
}