/*
 *
 * The contents of this file are subject to the Mozilla Public License
 * Version 1.1 (the "License"); you may not use this file except in
 * compliance with the License. You may obtain a copy of the License at
 *
 * http://www.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS IS"
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
 * License for the specific language governing rights and limitations under
 * the License.
 *
 * The Original Code is jRelationalFramework.
 *
 * The Initial Developer of the Original Code is is.com.
 * Portions created by is.com are Copyright (C) 2000 is.com.
 * All Rights Reserved.
 *
 * Contributor(s): Jonathan Carlson (joncrlsn@users.sf.net)
 * Contributor(s): ____________________________________
 *
 * Alternatively, the contents of this file may be used under the terms of
 * the GNU General Public License (the "GPL") or the GNU Lesser General
 * Public license (the "LGPL"), in which case the provisions of the GPL or
 * LGPL are applicable instead of those above.  If you wish to allow use of
 * your version of this file only under the terms of either the GPL or LGPL
 * and not to allow others to use your version of this file under the MPL,
 * indicate your decision by deleting the provisions above and replace them
 * with the notice and other provisions required by either the GPL or LGPL
 * License.  If you do not delete the provisions above, a recipient may use
 * your version of this file under either the MPL or GPL or LGPL License.
 *
 */
package videoStore;


import com.is.jrf.PersistentObject;

import java.util.List;


public class Video
    extends PersistentObject
  {
  private Integer i_id   = null;
  private String  i_title = null;
  private Integer i_numberOfCopies = null;
  private Integer i_maxRentalDays = null;
  /** this isn't stored in the table, but its' id is */
  private Genre   i_genre = null;
  /** this isn't stored in the table, but its' id is */
  private Media   i_media = null;
  /** this comes from a joined column */
  //  private String  i_mediaName = null;
  private List    i_customers = null;
  private Long    i_rentalPriceInCents = null;
  private Long    i_purchasePriceInCents = null;

  /** percentage of how often this is rented */
  private Float   i_volatilityPercent = null;

  public Video()
    {
    super();
    }

  /**
   * Construct a brand new instance that is ready to be inserted into the
   * database.
   *
   * @param title a value of type 'String'
   * @param numberOfCopies a value of type 'int'
   * @param genre a value of type 'Genre'
   */
  public Video(String title,
               int numberOfCopies,
               Genre genre,
               Media media)
    {
    super();
    i_title = title;
    i_numberOfCopies = new Integer(numberOfCopies);
    i_genre = genre;
    i_media = media;
    }


  public Integer getId()
    {
    return i_id;
    }
  public void setId(Integer id)
    {
    i_id = id;
    this.markModifiedPersistentState();
    }


  public String getTitle()
    {
    return i_title;
    }
  public void setTitle(String title)
    {
    i_title = title;
    this.markModifiedPersistentState();
    }


  public Genre getGenre()
    {
    return i_genre;
    }
  public void setGenre(Genre genre)
    {
    i_genre = genre;
    this.markModifiedPersistentState();
    }


  public Media getMedia()
    {
    return i_media;
    }
  /** This is used only for changing the media name */
  public void setMedia(Media media)
    {
    this.markModifiedPersistentState();
    i_media = media;
    }


  public Integer getNumberOfCopies()
    {
    return i_numberOfCopies;
    }
  public void setNumberOfCopies(Integer v)
    {
    i_numberOfCopies = v;
    }

  public List getCustomers()
    {
    return i_customers;
    }
  public void setCustomers(List v)
    {
    i_customers = v;
    }

  public Integer getMaxRentalDays()
    {
    return i_maxRentalDays;
    }
  public void setMaxRentalDays(Integer maxRentalDays)
    {
    i_maxRentalDays = maxRentalDays;
    }


  public Long getRentalPriceInCents()
    {
    return i_rentalPriceInCents;
    }
  public void setRentalPriceInCents(Long v)
    {
    i_rentalPriceInCents = v;
    }


  public Long getPurchasePriceInCents()
    {
    return i_purchasePriceInCents;
    }
  public void setPurchasePriceInCents(Long v)
    {
    i_purchasePriceInCents = v;
    }


  /** percentage of how often this is rented. */
  public Float getVolatilityPercent()
    {
    return i_volatilityPercent;
    }
  public void setVolatilityPercent(Float v)
    {
    i_volatilityPercent = v;
    }


  public String toString()
    {
    return super.toString() + "[" + i_title  + "]";
    }


  }