How do I structure my entities for easier persistence?
You are not correct in assuming the above... If you want to count the number of rentals for one Movie you can do the following (given you are not removing records from your database):

@NamedQueries{
   @NamedQuery(name="Movie.getRentalCount", 
       query="SELECT COUNT FROM Rentals r WHERE r.bookMovieId = :movieId")
}
@Entity
class Movie{

   @Transient
   public static final String getRentalCount = "uniqueQueryNameForMovie";

   // ... 
}




This allows you to do the following in your purchase process:

@Inject
EntityManager entityManager;

public Long getRentalCountForMovieId(long movieId){
    TypedQuery&lt;Long&gt; q = entityManager.createNamedQuery(Movie.getRentalCount, Long);
    q.setParameter("movieId", movieId);
    return q.getSingleResult();
}


You'd need to use the wrapper class, as TypedQuery only accepts Objects as type.

Also it should be unneccesary to create Rental instances while changing the contents of your cart. They should only be created when you check the cart out in the end, because before that there is no need for a Rental instance...

If you decided to destroy the instances of Rental on return of the Movie: You should keep a record of older Rentals for historization and usability reasons.