package m05bAsignacionEJB;

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

import m05bBD.m05bAsignacion;


/**
 * This class is the Bean Implementation for the Entity EJB <tt>M05AsignacionEB</tt>.
 *
 * @see     m05.exe.Asignacion
 * @see     m05.exe.M05AsignacionEB
 * @see     m05.exe.M05AsignacionEBPK
 * @see     m05.exe.M05AsignacionEBHome
 */
abstract public class m05AsignacionBean implements EntityBean {
  
  private EntityContext ctx;


  /** 
   * This is the primary key.
   * It is the clave, which is the primary key 
   * in table <tt>m0501t00</tt>.
   */
  
  /**
   * Returns the Asignacion information of this E-EJB.
   */    
  public m05bAsignacion getAsignacion(){
    m05bAsignacion asignacion = new m05bAsignacion();
    
    asignacion.setAsi_codigo(getAsi_codigo());
    asignacion.setAsi_matricula(getAsi_matricula());
    asignacion.setAsi_dni(getAsi_dni());
    asignacion.setAsi_fsolicitud(getAsi_fsolicitud());
    asignacion.setAsi_fdesde(getAsi_fdesde());
    asignacion.setAsi_fhasta(getAsi_fhasta());
    asignacion.setAsi_fdevolucion(getAsi_fdevolucion());
    asignacion.setAsi_kmsalida(getAsi_kmsalida());
    asignacion.setAsi_kmllegada(getAsi_kmllegada());
    asignacion.setAsi_kmrecorridos(getAsi_kmrecorridos());
    asignacion.setAsi_finalizada(getAsi_finalizada());
    asignacion.setAsi_orden(getAsi_orden());
    asignacion.setAsi_impreso(getAsi_impreso());
    asignacion.setAsi_fimpresion(getAsi_fimpresion());
    asignacion.setAsi_fdecreto(getAsi_fdecreto());
    asignacion.setAsi_fentrega(getAsi_fentrega());
    asignacion.setAsi_decreto(getAsi_decreto());
    asignacion.setAsi_entrega(getAsi_entrega());
    asignacion.setAsi_descdpto(getAsi_descdpto());
    asignacion.setAsi_coddpto(getAsi_coddpto());
    asignacion.setAsi_permanente(getAsi_permanente());
    asignacion.setAsi_codcargo(getAsi_codcargo());
    asignacion.setAsi_codrango(getAsi_codrango());
    asignacion.setAsi_observaciones(getAsi_observaciones());

    return asignacion;
  }    

  /**
   * Sets the Asignacion information of this E-EJB.
   * @exception P2GException 
   *              If the given Asignacion <tt>asi_codigo</tt> field 
   *              does not match the primary key that is in the E-EJB.
   */   
  public void setAsignacion(m05bAsignacion asignacion)
    throws Exception{
   
    //the primary key is never modified!!
    if (getAsi_codigo() != asignacion.getAsi_codigo())
      throw new CreateException ("Cannot modify a different asignacion");
      
    setAsi_matricula(asignacion.getAsi_matricula());
    setAsi_dni(asignacion.getAsi_dni());
    setAsi_fsolicitud(asignacion.getAsi_fsolicitud());
    setAsi_dni(asignacion.getAsi_dni());
    setAsi_fdesde(asignacion.getAsi_fdesde());
    setAsi_fhasta(asignacion.getAsi_fhasta());
    setAsi_fdevolucion(asignacion.getAsi_fdevolucion());
    setAsi_kmsalida(asignacion.getAsi_kmsalida());
    setAsi_kmllegada(asignacion.getAsi_kmllegada());
    setAsi_kmrecorridos(asignacion.getAsi_kmrecorridos());
    setAsi_finalizada(asignacion.getAsi_finalizada());
    setAsi_orden(asignacion.getAsi_orden());
    setAsi_impreso(asignacion.getAsi_impreso());
    setAsi_fimpresion(asignacion.getAsi_fimpresion());
    setAsi_fdecreto(asignacion.getAsi_fdecreto());
    setAsi_fentrega(asignacion.getAsi_fentrega());
    setAsi_decreto(asignacion.getAsi_decreto());
    setAsi_entrega(asignacion.getAsi_entrega());
    setAsi_descdpto(asignacion.getAsi_descdpto());
    setAsi_coddpto(asignacion.getAsi_coddpto());
    setAsi_permanente(asignacion.getAsi_permanente());
    setAsi_codcargo(asignacion.getAsi_codcargo());
    setAsi_codrango(asignacion.getAsi_codrango());
    setAsi_observaciones(asignacion.getAsi_observaciones());

  }
  
  abstract public String getAsi_codigo();
  abstract public void setAsi_codigo(String n);
  
  abstract public String getAsi_matricula();
  abstract public void setAsi_matricula(String n);
  
  abstract public String getAsi_dni();
  abstract public void setAsi_dni(String n);
  
  abstract public String getAsi_fsolicitud();
  abstract public void setAsi_fsolicitud(String n);
  
  abstract public String getAsi_fdesde();
  abstract public void setAsi_fdesde(String n);

  abstract public String getAsi_fhasta();
  abstract public void setAsi_fhasta(String n);

  abstract public String getAsi_fdevolucion();
  abstract public void setAsi_fdevolucion(String n);

  abstract public String getAsi_kmsalida();
  abstract public void setAsi_kmsalida(String n);

  abstract public String getAsi_kmllegada();
  abstract public void setAsi_kmllegada(String n);

  abstract public String getAsi_kmrecorridos();
  abstract public void setAsi_kmrecorridos(String n);


  abstract public String getAsi_finalizada();
  abstract public void setAsi_finalizada(String n);
  
  abstract public String getAsi_orden();
  abstract public void setAsi_orden(String n);
  
  abstract public String getAsi_impreso();
  abstract public void setAsi_impreso(String n);

  abstract public String getAsi_fimpresion();
  abstract public void setAsi_fimpresion(String n);

  abstract public String getAsi_fdecreto();
  abstract public void setAsi_fdecreto(String n);

  abstract public String getAsi_fentrega();
  abstract public void setAsi_fentrega(String n);

  abstract public String getAsi_decreto();
  abstract public void setAsi_decreto(String n);

  abstract public String getAsi_entrega();
  abstract public void setAsi_entrega(String n);
  
  abstract public String getAsi_descdpto();
  abstract public void setAsi_descdpto(String n);

  abstract public String getAsi_coddpto();
  abstract public void setAsi_coddpto(String n);

  abstract public String getAsi_permanente();
  abstract public void setAsi_permanente(String n);
  
  abstract public String getAsi_codcargo();
  abstract public void setAsi_codcargo(String n);
  
  abstract public String getAsi_codrango();
  abstract public void setAsi_codrango(String n);

  abstract public String getAsi_observaciones();
  abstract public void setAsi_observaciones(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 Asignacion 
   * information of this E-EJB.
   * It assigns a new primary key to the Asignacion.
   */ 
  public m05AsignacionPK ejbCreate(m05bAsignacion asignacion) 
    throws CreateException
  {
    try {
      setAsi_codigo(getAsi_codigo());
    } catch (Exception e) {
      throw new CreateException (e.getMessage());
    }    
    setAsi_matricula(asignacion.getAsi_matricula());
    setAsi_dni(asignacion.getAsi_dni());
    setAsi_fsolicitud(asignacion.getAsi_fsolicitud());
    setAsi_fdesde(asignacion.getAsi_fdesde());
    setAsi_fhasta(asignacion.getAsi_fhasta());
    setAsi_fdevolucion(asignacion.getAsi_fdevolucion());
    setAsi_kmsalida(asignacion.getAsi_kmsalida());
    setAsi_kmllegada(asignacion.getAsi_kmllegada());
    setAsi_kmrecorridos(asignacion.getAsi_kmrecorridos());
    setAsi_finalizada(asignacion.getAsi_finalizada());
    setAsi_orden(asignacion.getAsi_orden());
    setAsi_impreso(asignacion.getAsi_impreso());
    setAsi_fimpresion(asignacion.getAsi_fimpresion());
    setAsi_fdecreto(asignacion.getAsi_fdecreto());
    setAsi_fentrega(asignacion.getAsi_fentrega());
    setAsi_decreto(asignacion.getAsi_decreto());
    setAsi_entrega(asignacion.getAsi_entrega());
    setAsi_descdpto(asignacion.getAsi_descdpto());
    setAsi_coddpto(asignacion.getAsi_coddpto());
    setAsi_permanente(asignacion.getAsi_permanente());
    setAsi_codcargo(asignacion.getAsi_codcargo());
    setAsi_codrango(asignacion.getAsi_codrango());
    setAsi_observaciones(asignacion.getAsi_observaciones());
    return null;
  }

  public void ejbPostCreate(m05bAsignacion asignacion) 
  {
  }

 
}
