package m05bSiniestrosEJB;

/*
 * Date: Mar 26, 2004
 * This class is the Bean Implementation for the Entity EJB <tt>M05SiniestrosEB</tt>.
 *
 * @see     m05.exe.Siniestros
 * @see     m05.exe.M05SiniestrosEB
 * @see     m05.exe.M05SiniestrosEBPK
 * @see     m05.exe.M05SiniestrosEBHome
 */

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

import m05bBD.m05bSiniestros;


abstract public class m05SiniestrosBean implements EntityBean {

  private EntityContext ctx;

  

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

  /**
   * Returns the Seguro information of this E-EJB.
   */
  public m05bSiniestros getSiniestro(){
    m05bSiniestros siniestro = new m05bSiniestros();

    siniestro.setSin_codigo(getSin_codigo());
    siniestro.setSin_aseguradoracc(getSin_aseguradoracc());
    siniestro.setSin_dni(getSin_dni());
    siniestro.setSin_dniacc(getSin_dniacc());
    siniestro.setSin_dnicc(getSin_dnicc());
    siniestro.setSin_fecresolucion(getSin_fecresolucion());
    siniestro.setSin_fecsiniestro(getSin_fecsiniestro());
    siniestro.setSin_importe(getSin_importe());
    siniestro.setSin_matricula(getSin_matricula());
    siniestro.setSin_matriculacc(getSin_matriculacc());
    siniestro.setSin_nombreacc(getSin_nombreacc());
    siniestro.setSin_nombrecc(getSin_nombrecc());
    siniestro.setSin_nrefaseg(getSin_nrefaseg());
    siniestro.setSin_observacion(getSin_observacion());
    siniestro.setSin_peritado(getSin_peritado());
    siniestro.setSin_polizacc(getSin_polizacc());
    siniestro.setSin_responsable(getSin_responsable());
    siniestro.setSin_taller(getSin_taller());
    return siniestro;
  }

  /**
   * Sets the Seguro information of this E-EJB.
   * @exception P2GException
   *              If the given Seguro <tt>sin_codigo</tt> field
   *              does not match the primary key that is in the E-EJB.
   */
  public void setSiniestro(m05bSiniestros siniestro)
    throws Exception{

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

    setSin_aseguradoracc (siniestro.getSin_aseguradoracc());
    setSin_dni(siniestro.getSin_dni());
    setSin_dniacc(siniestro.getSin_dniacc());
    setSin_dnicc(siniestro.getSin_dnicc());
    setSin_fecresolucion(siniestro.getSin_fecresolucion());
    setSin_fecsiniestro(siniestro.getSin_fecsiniestro());
    setSin_importe(siniestro.getSin_importe());
    setSin_matricula(siniestro.getSin_matricula());
    setSin_matriculacc(siniestro.getSin_matriculacc());
    setSin_nombreacc(siniestro.getSin_nombreacc());
    setSin_nombrecc(siniestro.getSin_nombrecc());
    setSin_nrefaseg(siniestro.getSin_nrefaseg());
    setSin_observacion(siniestro.getSin_observacion());
    setSin_peritado(siniestro.getSin_peritado());
    setSin_polizacc(siniestro.getSin_polizacc());
    setSin_responsable(siniestro.getSin_responsable());
    setSin_taller(siniestro.getSin_taller());
  }

  abstract public String getSin_codigo();
  abstract public void setSin_codigo(String n);

  abstract public String getSin_dni();
  abstract public void setSin_dni(String n);

  abstract public String getSin_aseguradoracc();
  abstract public void setSin_aseguradoracc(String n);

  abstract public String getSin_dniacc();
  abstract public void setSin_dniacc(String n);

  abstract public String getSin_dnicc();
  abstract public void setSin_dnicc(String n);

  abstract public String getSin_nombrecc();
  abstract public void setSin_nombrecc(String n);

  abstract public String getSin_nombreacc();
  abstract public void setSin_nombreacc(String n);

  abstract public String getSin_polizacc();
  abstract public void setSin_polizacc(String n);

  abstract public String getSin_nrefaseg();
  abstract public void setSin_nrefaseg(String n);

  abstract public String getSin_fecresolucion();
  abstract public void setSin_fecresolucion(String n);

  abstract public String getSin_fecsiniestro();
  abstract public void setSin_fecsiniestro(String n);

  abstract public String getSin_importe();
  abstract public void setSin_importe(String n);

  abstract public String getSin_matricula();
  abstract public void setSin_matricula(String n);

  abstract public String getSin_matriculacc();
  abstract public void setSin_matriculacc(String n);

  abstract public String getSin_observacion();
  abstract public void setSin_observacion(String n);

  abstract public String getSin_peritado();
  abstract public void setSin_peritado(String n);

  abstract public String getSin_responsable();
  abstract public void setSin_responsable(String n);

  abstract public String getSin_taller();
  abstract public void setSin_taller(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 Siniestro
   * information of this E-EJB.
   * It assigns a new primary key to the Seguro.
   */
  public m05SiniestrosPK ejbCreate(m05bSiniestros siniestro)
    throws CreateException
  {
    try {
      setSin_codigo(getSin_codigo());
    } catch (Exception e) {
      throw new CreateException (e.getMessage());
    }
    setSin_aseguradoracc(siniestro.getSin_aseguradoracc());
    setSin_dni(siniestro.getSin_dni());
    setSin_dniacc(siniestro.getSin_dniacc());
    setSin_dnicc(siniestro.getSin_dnicc());
    setSin_fecresolucion(siniestro.getSin_fecresolucion());
    setSin_fecsiniestro(siniestro.getSin_fecsiniestro());
    setSin_importe(siniestro.getSin_importe());
    setSin_matricula(siniestro.getSin_matricula());
    setSin_matriculacc(siniestro.getSin_matriculacc());
    setSin_nombreacc(siniestro.getSin_nombreacc());
    setSin_nombrecc(siniestro.getSin_nombrecc());
    setSin_nrefaseg(siniestro.getSin_nrefaseg());
    setSin_observacion(siniestro.getSin_observacion());
    setSin_peritado(siniestro.getSin_peritado());
    setSin_polizacc(siniestro.getSin_polizacc());
    setSin_responsable(siniestro.getSin_responsable());
    setSin_taller(siniestro.getSin_taller());
    return null;
  }

  public void ejbPostCreate(m05bSiniestros siniestro)
  {
  }


}

