package m05bGastosEJB;

/**/
import javax.ejb.CreateException;
import javax.ejb.EntityBean;
import javax.ejb.EntityContext;
import javax.ejb.RemoveException;

import m05bBD.m05bGastos;


/**
 * This class is the Bean Implementation for the Entity EJB <tt>M05GastosEB</tt>.
 *
 * @see     m05.exe.Gastos
 * @see     m05.exe.M05GastosEB
 * @see     m05.exe.M05GastosEBPK
 * @see     m05.exe.M05GastosEBHome
 */
abstract public class m05GastosBean implements EntityBean {

  private EntityContext ctx;

 

  /**
   * This is the primary key.
   * It is the clave, which is the primary key
   * in table <tt>m0509t00</tt>.
   */


  /**
   * Returns the Pieza information of this E-EJB.
   */
  public m05bGastos getGastos(){
    m05bGastos gastos = new m05bGastos();

    gastos.setGas_codigo(getGas_codigo());
    gastos.setGas_tarjeta(getGas_tarjeta());
    gastos.setGas_fgasto(getGas_fgasto());
    gastos.setGas_litros(getGas_litros());
    gastos.setGas_estbcif(getGas_estbcif());
    gastos.setGas_estnombre(getGas_estnombre());
    gastos.setGas_cargo (getGas_cargo());
    gastos.setGas_importe (getGas_importe());
    gastos.setGas_matricula(getGas_matricula());
    gastos.setGas_kilometros(getGas_kilometros());
    gastos.setGas_codcpto(getGas_codcpto());

    return gastos;
  }

  /**
   * Sets the Gastos information of this E-EJB.
   * @exception P2GException
   *              If the given Gastos <tt>gas_codigo</tt> field
   *              does not match the primary key that is in the E-EJB.
   */
  public void setGastos(m05bGastos gastos)
    throws Exception{

    //the primary key is never modified!!
    if (getGas_codigo() != gastos.getGas_codigo())
      throw new CreateException ("Cannot modify a different gastos");

          setGas_tarjeta(gastos.getGas_tarjeta());
          setGas_fgasto(gastos.getGas_fgasto());
          setGas_litros(gastos.getGas_litros());
          setGas_estbcif(gastos.getGas_estbcif());
          setGas_estnombre(gastos.getGas_estnombre());
          setGas_cargo (gastos.getGas_cargo());
          setGas_importe (gastos.getGas_importe());
          setGas_matricula(gastos.getGas_matricula());
          setGas_kilometros(gastos.getGas_kilometros());
          setGas_codcpto(gastos.getGas_codcpto());

  }

  abstract public String getGas_codigo();
  abstract public void setGas_codigo(String n);

  abstract public String getGas_tarjeta();
  abstract public void setGas_tarjeta(String n);

  abstract public String getGas_fgasto();
  abstract public void setGas_fgasto(String n);

  abstract public String getGas_litros();
  abstract public void setGas_litros(String n);

  abstract public String getGas_estbcif();
  abstract public void setGas_estbcif(String n);

  abstract public String getGas_estnombre();
  abstract public void setGas_estnombre(String n);

  abstract public String getGas_cargo();
  abstract public void setGas_cargo(String n);

  abstract public String getGas_importe ();
  abstract public void setGas_importe (String n);

  abstract public String getGas_matricula();
  abstract public void setGas_matricula(String n);

  abstract public String getGas_kilometros();
  abstract public void setGas_kilometros(String n);

  abstract public String getGas_codcpto();
  abstract public void setGas_codcpto(String n);

  public void ejbActivate() {
  }

  public void ejbPassivate() {
  }

  public void setEntityContext(EntityContext ctx) {
    this.ctx = ctx;
  }

  public void unsetEntityContext() {
    this.ctx = null;
  }

  public void ejbLoad() {
  }

  public void ejbStore() {
  }

  public void ejbRemove()
    throws RemoveException
  {
  }

  /**
   * This function initializes the Gastos
   * information of this E-EJB.
   * It assigns a new primary key to the Gastos.
   */
  public m05GastosPK ejbCreate(m05bGastos gastos)
    throws CreateException
  {
    try {
      setGas_codigo(getGas_codigo());
    } catch (Exception e) {
      throw new CreateException (e.getMessage());
    }
               setGas_tarjeta(gastos.getGas_tarjeta());
                setGas_fgasto(gastos.getGas_fgasto());
                setGas_litros(gastos.getGas_litros());
                setGas_estbcif(gastos.getGas_estbcif());
                setGas_estnombre(gastos.getGas_estnombre());
                setGas_cargo (gastos.getGas_cargo());
                setGas_importe (gastos.getGas_importe());
                setGas_matricula(gastos.getGas_matricula());
                setGas_kilometros(gastos.getGas_kilometros());
                setGas_codcpto(gastos.getGas_codcpto());

    return null;
  }

  public void ejbPostCreate(m05bGastos gastos)
  {
  }



}
