package airline.ejb;

/**
 * This class is part of Middlegen airlines, and it is
 * a CMP EJB accessing the RESERVATIONS table.
 *
 * @author <a href="http://boss.bekk.no/boss/middlegen/">Middlegen</a>
 * @todo generate create methods which don't take pk as arg (and use an arbitrary pk generator internally)
 *
 *
 * @ejb.bean
 *    type="CMP"
 *    cmp-version="2.x"
 *    name="Reservation"
 *    local-jndi-name="airline.ReservationLocalHome"
 *    view-type="local"
 *
 * @ejb.finder
 *    signature="java.util.Collection findAll()"
 *    result-type-mapping="Local"
 *    method-intf="LocalHome"
 *    query="SELECT OBJECT(o) FROM Reservation o"
 *
 * @ejb.finder
 *    signature="java.util.Collection findByRegistrationUtc(java.sql.Timestamp registrationUtc)"
 *    result-type-mapping="Local"
 *    method-intf="LocalHome"
 *    query="SELECT DISTINCT OBJECT(o) FROM Reservation o WHERE o.registrationUtc = ?1"
 *    description="REGISTRATION_UTC is indexed."
 *
 * @ejb.finder
 *    signature="java.util.Collection findByComment(java.lang.String comment)"
 *    result-type-mapping="Local"
 *    method-intf="LocalHome"
 *    query="SELECT DISTINCT OBJECT(o) FROM Reservation o WHERE o.comment = ?1"
 *    description="COMMENT is not indexed."
 *
 * @ejb.persistence table-name="RESERVATIONS"
 *
 * @weblogic.data-source-name airline.database
 */
public abstract class ReservationBean implements javax.ejb.EntityBean {

   /**
    * Returns the reservationId
    * @todo support OracleClob,OracleBlob on WLS
    *
    * @return the reservationId
    *
    * @ejb.pk-field
    * @ejb.interface-method view-type="local"
    * @ejb.persistence column-name="RESERVATION_ID"
    */
   public abstract java.lang.Integer getReservationId();

   /**
    * Sets the reservationId
    *
    * @param java.lang.Integer the new reservationId value
    */
   public abstract void setReservationId(java.lang.Integer reservationId);

   /**
    * Returns the personIdFk
    * @todo support OracleClob,OracleBlob on WLS
    *
    * @return the personIdFk
    *
    * @ejb.pk-field
    * @ejb.interface-method view-type="local"
    * @ejb.persistence column-name="PERSON_ID_FK"
    */
   public abstract java.lang.Integer getPersonIdFk();

   /**
    * Sets the personIdFk
    *
    * @param java.lang.Integer the new personIdFk value
    */
   public abstract void setPersonIdFk(java.lang.Integer personIdFk);

   /**
    * Returns the flightIdFk
    * @todo support OracleClob,OracleBlob on WLS
    *
    * @return the flightIdFk
    *
    * @ejb.pk-field
    * @ejb.interface-method view-type="local"
    * @ejb.persistence column-name="FLIGHT_ID_FK"
    */
   public abstract java.lang.Integer getFlightIdFk();

   /**
    * Sets the flightIdFk
    *
    * @param java.lang.Integer the new flightIdFk value
    */
   public abstract void setFlightIdFk(java.lang.Integer flightIdFk);

   /**
    * Returns the registrationUtc
    * @todo support OracleClob,OracleBlob on WLS
    *
    * @return the registrationUtc
    *
    * @ejb.interface-method view-type="local"
    * @ejb.persistence column-name="REGISTRATION_UTC"
    */
   public abstract java.sql.Timestamp getRegistrationUtc();

   /**
    * Sets the registrationUtc
    *
    * @param java.sql.Timestamp the new registrationUtc value
    * @ejb.interface-method view-type="local"
    */
   public abstract void setRegistrationUtc(java.sql.Timestamp registrationUtc);

   /**
    * Returns the comment
    * @todo support OracleClob,OracleBlob on WLS
    *
    * @return the comment
    *
    * @ejb.interface-method view-type="local"
    * @ejb.persistence column-name="COMMENT"
    */
   public abstract java.lang.String getComment();

   /**
    * Sets the comment
    *
    * @param java.lang.String the new comment value
    * @ejb.interface-method view-type="local"
    */
   public abstract void setComment(java.lang.String comment);

   /**
    * This is a bi-directional one-to-many relationship CMR method
    *
    * @return the related airline.interfaces.FlightLocal.
    *
    * @ejb.interface-method view-type="local"
    *
    * @ejb.relation
    *    name="FLIGHTS-cmp20-RESERVATIONS-cmp20"
    *    role-name="RESERVATIONS-cmp20-has-FLIGHTS-cmp20"
    *
    * @jboss.relation-mapping style="foreign-key"
    *
    * @weblogic.column-map
    *    foreign-key-column="FLIGHT_ID_FK"
    *    key-column="FLIGHT_ID"
    *
    * @jboss.relation
    *    fk-constraint="true"
    *    fk-column="FLIGHT_ID_FK"
    *    related-pk-field="flightId"
    *
    */
   public abstract airline.interfaces.FlightLocal getFlight();

   /**
    * Sets the related airline.interfaces.FlightLocal
    *
    * @param airline.interfaces.ReservationLocal the related $target.variableName
    *
    * @ejb.interface-method view-type="local"
    *
    * @param flight the new CMR value
    */
   public abstract void setFlight(airline.interfaces.FlightLocal flight);

   /**
    * This is a bi-directional one-to-many relationship CMR method
    *
    * @return the related airline.interfaces.PersonLocal.
    *
    * @ejb.interface-method view-type="local"
    *
    * @ejb.relation
    *    name="PERSONS-cmp20-RESERVATIONS-cmp20"
    *    role-name="RESERVATIONS-cmp20-has-PERSONS-cmp20"
    *
    * @jboss.relation-mapping style="foreign-key"
    *
    * @weblogic.column-map
    *    foreign-key-column="PERSON_ID_FK"
    *    key-column="PERSON_ID"
    *
    * @jboss.relation
    *    fk-constraint="true"
    *    fk-column="PERSON_ID_FK"
    *    related-pk-field="personId"
    *
    */
   public abstract airline.interfaces.PersonLocal getPerson();

   /**
    * Sets the related airline.interfaces.PersonLocal
    *
    * @param airline.interfaces.ReservationLocal the related $target.variableName
    *
    * @ejb.interface-method view-type="local"
    *
    * @param person the new CMR value
    */
   public abstract void setPerson(airline.interfaces.PersonLocal person);

   /**
    * This create method takes only mandatory (non-nullable) parameters. The pk columns must be provided.
    *
    * When the client invokes a create method, the EJB container invokes the ejbCreate method. 
    * Typically, an ejbCreate method in an entity bean performs the following tasks: 
    * <UL>
    * <LI>Inserts the entity state into the database.</LI>
    * <LI>Initializes the instance variables.</LI>
    * <LI>Returns the primary key.</LI>
    * </UL>
    *
    * @param reservationId the reservationId value
    * @param registrationUtc the registrationUtc value
    * @param flight mandatory CMR field
    * @param person mandatory CMR field
    * @return the primary key of the new instance
    *
    * @ejb.create-method
    */
   public airline.interfaces.ReservationPK ejbCreate( java.lang.Integer reservationId, java.sql.Timestamp registrationUtc, airline.interfaces.FlightLocal flight, airline.interfaces.PersonLocal person ) throws javax.ejb.CreateException {
      setReservationId(reservationId);
      setRegistrationUtc(registrationUtc);
      // EJB 2.0 spec says return null for CMP ejbCreate methods.
      return null;
   }

   /**
    * The container invokes thos method immediately after it calls ejbCreate. 
    *
    * @param reservationId the reservationId value
    * @param registrationUtc the registrationUtc value
    * @param flight mandatory CMR field
    * @param person mandatory CMR field
    */
   public void ejbPostCreate( java.lang.Integer reservationId, java.sql.Timestamp registrationUtc, airline.interfaces.FlightLocal flight, airline.interfaces.PersonLocal person ) throws javax.ejb.CreateException {
      // Set CMR fields
      setFlight(flight);
      setPerson(person);
   }

   /**
    * This create method takes all parameters (both nullable and not nullable). The pk columns must be provided.
    *
    * When the client invokes a create method, the EJB container invokes the ejbCreate method. 
    * Typically, an ejbCreate method in an entity bean performs the following tasks: 
    * <UL>
    * <LI>Inserts the entity state into the database.</LI>
    * <LI>Initializes the instance variables.</LI>
    * <LI>Returns the primary key.</LI>
    * </UL>
    *
    * @param reservationId the reservationId value
    * @param registrationUtc the registrationUtc value
    * @param comment the comment value
    * @param flight CMR field
    * @param person CMR field
    * @return the primary key of the new instance
    *
    * @ejb.create-method
    */
   public airline.interfaces.ReservationPK ejbCreate( java.lang.Integer reservationId, java.sql.Timestamp registrationUtc, java.lang.String comment, airline.interfaces.FlightLocal flight, airline.interfaces.PersonLocal person ) throws javax.ejb.CreateException {
      // Set CMP fields
      setReservationId(reservationId);
      setRegistrationUtc(registrationUtc);
      setComment(comment);
      // EJB 2.0 spec says return null for CMP ejbCreate methods.
      return null;
   }

   /**
    * The container invokes thos method immediately after it calls ejbCreate. 
    *
    * @param reservationId the reservationId value
    * @param registrationUtc the registrationUtc value
    * @param comment the comment value
    * @param flight CMR field
    * @param person CMR field
    */
   public void ejbPostCreate( java.lang.Integer reservationId, java.sql.Timestamp registrationUtc, java.lang.String comment, airline.interfaces.FlightLocal flight, airline.interfaces.PersonLocal person ) throws javax.ejb.CreateException {
      // Set CMR fields
      setFlight(flight);
      setPerson(person);
   }

     
   // No /home/pro/middlegen/02.09.02/middlegen/samples/src/middlegen/cmp20-reservations-class-code.txt found.

}
