/*
* JBoss, Home of Professional Open Source
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
//$Id: Company.java,v 1.1.2.6 2005/09/27 01:49:19 starksm Exp $
package org.jboss.ejb3.test.entity;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratorType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.OneToMany;
import javax.persistence.Entity;
import java.util.Set;


/**
 * Corporate like Air France
 *
 * @author Emmanuel Bernard
 */
@Entity()
public class Company implements java.io.Serializable
{
   private Integer id;
   private String name;
   private Set<Flight> flights;

   @Id(generate = GeneratorType.IDENTITY)
   public Integer getId()
   {
      return id;
   }

   public String getName()
   {
      return name;
   }


   public void setId(Integer integer)
   {
      id = integer;
   }


   public void setName(String string)
   {
      name = string;
   }


   @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy="company")
   public Set<Flight> getFlights()
   {
      return flights;
   }

   public void setFlights(Set<Flight> flights)
   {
      this.flights = flights;
   }


}
