package m05bGastosTarjetaEJB;

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

import m05bBD.m05bGastosTarjeta;

/**
 * This class is the Bean Implementation for the Entity EJB <tt>M05GastosTarjetaEB</tt>.
 *
 * @see     m05.exe.GastosTarjeta
 * @see     m05.exe.M05GastosTarjetaEB
 * @see     m05.exe.M05GastosTarjetaEBPK
 * @see     m05.exe.M05GastosTarjetaEBHome
 */

abstract public class m05GastosTarjetaBean implements EntityBean {


  private EntityContext ctx;

 

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


  /**
   * Returns the Pieza information of this E-EJB.
   */
  public m05bGastosTarjeta getGastosTarjeta(){
    m05bGastosTarjeta gastostarjeta = new m05bGastosTarjeta();

    gastostarjeta.setGastar_control(getGastar_control());
    gastostarjeta.setGastar_tarjeta(getGastar_tarjeta());
    gastostarjeta.setGastar_fecha(getGastar_fecha());
    gastostarjeta.setGastar_litros(getGastar_litros());
    gastostarjeta.setGastar_estcif(getGastar_estcif());
    gastostarjeta.setGastar_estdesc(getGastar_estdesc());
    gastostarjeta.setGastar_cargo (getGastar_cargo());
    gastostarjeta.setGastar_importe (getGastar_importe());
    gastostarjeta.setGastar_matricula(getGastar_matricula());
    gastostarjeta.setGastar_km(getGastar_km());
    gastostarjeta.setGastar_concepto(getGastar_concepto());
    gastostarjeta.setGastar_ueconomic (getGastar_ueconomic());
    gastostarjeta.setGastar_tipo (getGastar_tipo());
    gastostarjeta.setGastar_centro(getGastar_centro());
    gastostarjeta.setGastar_verifi(getGastar_verifi());
    gastostarjeta.setGastar_ncomercio(getGastar_ncomercio());

    return gastostarjeta;
  }

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

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

          setGastar_tarjeta(gastostarjeta.getGastar_tarjeta());
          setGastar_fecha(gastostarjeta.getGastar_fecha());
          setGastar_litros(gastostarjeta.getGastar_litros());
          setGastar_estcif(gastostarjeta.getGastar_estcif());
          setGastar_estdesc(gastostarjeta.getGastar_estdesc());
          setGastar_cargo (gastostarjeta.getGastar_cargo());
          setGastar_importe (gastostarjeta.getGastar_importe());
          setGastar_matricula(gastostarjeta.getGastar_matricula());
          setGastar_km(gastostarjeta.getGastar_km());
          setGastar_concepto(gastostarjeta.getGastar_concepto());
          setGastar_verifi(gastostarjeta.getGastar_verifi());
          setGastar_centro(gastostarjeta.getGastar_centro());
          setGastar_ueconomic(gastostarjeta.getGastar_ueconomic());
          setGastar_tipo(gastostarjeta.getGastar_tipo());
          setGastar_tipo(gastostarjeta.getGastar_ncomercio());


  }

  abstract public String getGastar_control();
  abstract public void setGastar_control(String n);

  abstract public String getGastar_tarjeta();
  abstract public void setGastar_tarjeta(String n);

  abstract public String getGastar_fecha();
  abstract public void setGastar_fecha(String n);

  abstract public String getGastar_litros();
  abstract public void setGastar_litros(String n);

  abstract public String getGastar_estcif();
  abstract public void setGastar_estcif(String n);

  abstract public String getGastar_estdesc();
  abstract public void setGastar_estdesc(String n);

  abstract public String getGastar_cargo();
  abstract public void setGastar_cargo(String n);

  abstract public String getGastar_importe ();
  abstract public void setGastar_importe (String n);

  abstract public String getGastar_matricula();
  abstract public void setGastar_matricula(String n);

  abstract public String getGastar_km();
  abstract public void setGastar_km(String n);

  abstract public String getGastar_verifi();
  abstract public void setGastar_verifi(String n);

  abstract public String getGastar_centro();
  abstract public void setGastar_centro(String n);

  abstract public String getGastar_concepto();
  abstract public void setGastar_concepto(String n);

  abstract public String getGastar_ueconomic();
  abstract public void setGastar_ueconomic(String n);

  abstract public String getGastar_tipo();
  abstract public void setGastar_tipo(String n);
  
  abstract public String getGastar_ncomercio();
  abstract public void setGastar_ncomercio(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 m05GastosTarjetaPK ejbCreate(m05bGastosTarjeta gastostarjeta)
    throws CreateException
  {
    try {
      setGastar_control(gastostarjeta.getGastar_control());
    } catch (Exception e) {
      throw new CreateException (e.getMessage());
    }
                setGastar_tarjeta(gastostarjeta.getGastar_tarjeta());
                setGastar_fecha(gastostarjeta.getGastar_fecha());
                setGastar_litros(gastostarjeta.getGastar_litros());
                setGastar_estcif(gastostarjeta.getGastar_estcif());
                setGastar_estdesc(gastostarjeta.getGastar_estdesc());
                setGastar_cargo (gastostarjeta.getGastar_cargo());
                setGastar_importe (gastostarjeta.getGastar_importe());
                setGastar_matricula(gastostarjeta.getGastar_matricula());
                setGastar_km(gastostarjeta.getGastar_km());
                setGastar_tipo(gastostarjeta.getGastar_tipo());
                setGastar_ueconomic(gastostarjeta.getGastar_ueconomic());
                setGastar_verifi(gastostarjeta.getGastar_verifi());
                setGastar_centro(gastostarjeta.getGastar_centro());
                setGastar_concepto(gastostarjeta.getGastar_concepto());
                setGastar_ncomercio(gastostarjeta.getGastar_ncomercio());


    return null;
  }

  public void ejbPostCreate(m05bGastosTarjeta gastostarjeta)
  {
  }

}
