Overview of This Tutorial
New videos are purchased periodically from movie distributors and added to the store inventory. Usually the video titles are new to the store, but sometimes they are additional copies of videos already in stock. To accurately track these transactions, a new record representing the purchase of copies of a video is added to the purchase table. After this table insertion, the program determines if the video already exists in the current stock. If it does exist, the videos table is updated to reflect that additional copies of a given video have been purchased. If the video does not exist in the current stock, a new video is added to the inventory.
This tutorial uses classes VVPurchase, VVPurchaseRepository, VVVideo, and VVVideoRepository.