gt:                 return new Integer(getId());
context: package net.idtoki.serteca.model;
  
  
  import java.math.BigDecimal;
  import java.sql.Connection;
  import java.util.ArrayList;
  import java.util.Collections;
  import java.util.Date;
  import java.util.List;
  
  import net.zylk.tools.ajax.AjaxUtils;
  
  import org.apache.commons.lang.ObjectUtils;
  import org.apache.torque.TorqueException;
  import org.apache.torque.om.BaseObject;
  import org.apache.torque.om.ComboKey;
  import org.apache.torque.om.DateKey;
  import org.apache.torque.om.NumberKey;
  import org.apache.torque.om.ObjectKey;
  import org.apache.torque.om.SimpleKey;
  import org.apache.torque.om.StringKey;
  import org.apache.torque.om.Persistent;
  import org.apache.torque.util.Criteria;
  import org.apache.torque.util.Transaction;
  
    
    
  /**
   * This class was autogenerated by Torque on:
   *
   * [Mon Jul 03 11:03:24 CEST 2006]
   *
   * You should not use this class directly.  It should not even be
   * extended all references should be to Reparacion
   */
  public abstract class BaseReparacion extends BaseObject
  {
      /** The Peer class */
      private static final ReparacionPeer peer =
          new ReparacionPeer();
  
                                              
      /** The value for the id field */
      private int id = -1;
                                            
      /** The value for the km field */
      private int km = 0;
                                                  
      /** The value for the deposito field */
      private String deposito = "";
        
      /** The value for the fechaEntrada field */
      private String fechaEntrada;
        
      /** The value for the fechaSalida field */
      private String fechaSalida;
        
      /** The value for the obs field */
      private String obs;
        
      /** The value for the estadoPrevio field */
      private String estadoPrevio;
        
      /** The value for the responsable field */
      private String responsable;
        
      /** The value for the vehiculoId field */
      private int vehiculoId;
                                            
      /** The value for the importe field */
      private double importe = 0;
                                            
      /** The value for the estado field */
      private int estado = 0;
    
      
      /**
       * Get the Id
       *
       * @return int
       */
      public int getId()
      {
          return id;
      }
  
                                                
      /**
       * Set the value of Id
       *
       * @param v new value
       */
      public void setId(int v) throws TorqueException
      {
      
                    if (this.id != v)
                {
              this.id = v;
              setModified(true);
          }
      
            
                                    
                                                      
                                                      
                                  }
    
      /**
       * Get the Km
       *
       * @return int
       */
      public int getKm()
      {
          return km;
      }
  
                          
      /**
       * Set the value of Km
       *
       * @param v new value
       */
      public void setKm(int v) 
      {
      
                    if (this.km != v)
                {
              this.km = v;
              setModified(true);
          }
      
            
                }
    
      /**
       * Get the Deposito
       *
       * @return String
       */
      public String getDeposito()
      {
          return deposito;
      }
  
                          
      /**
       * Set the value of Deposito
       *
       * @param v new value
       */
      public void setDeposito(String v) 
      {
      
                    if (!ObjectUtils.equals(this.deposito, v))
                {
              this.deposito = v;
              setModified(true);
          }
      
            
                }
    
      /**
       * Get the FechaEntrada
       *
       * @return String
       */
      public String getFechaEntrada()
      {
          return fechaEntrada;
      }
  
                          
      /**
       * Set the value of FechaEntrada
       *
       * @param v new value
       */
      public void setFechaEntrada(String v) 
      {
      
                    if (!ObjectUtils.equals(this.fechaEntrada, v))
                {
              this.fechaEntrada = v;
              setModified(true);
          }
      
            
                }
    
      /**
       * Get the FechaSalida
       *
       * @return String
       */
      public String getFechaSalida()
      {
          return fechaSalida;
      }
  
                          
      /**
       * Set the value of FechaSalida
       *
       * @param v new value
       */
      public void setFechaSalida(String v) 
      {
      
                    if (!ObjectUtils.equals(this.fechaSalida, v))
                {
              this.fechaSalida = v;
              setModified(true);
          }
      
            
                }
    
      /**
       * Get the Obs
       *
       * @return String
       */
      public String getObs()
      {
          return obs;
      }
  
                          
      /**
       * Set the value of Obs
       *
       * @param v new value
       */
      public void setObs(String v) 
      {
      
                    if (!ObjectUtils.equals(this.obs, v))
                {
              this.obs = v;
              setModified(true);
          }
      
            
                }
    
      /**
       * Get the EstadoPrevio
       *
       * @return String
       */
      public String getEstadoPrevio()
      {
          return estadoPrevio;
      }
  
                          
      /**
       * Set the value of EstadoPrevio
       *
       * @param v new value
       */
      public void setEstadoPrevio(String v) 
      {
      
                    if (!ObjectUtils.equals(this.estadoPrevio, v))
                {
              this.estadoPrevio = v;
              setModified(true);
          }
      
            
                }
    
      /**
       * Get the Responsable
       *
       * @return String
       */
      public String getResponsable()
      {
          return responsable;
      }
  
                          
      /**
       * Set the value of Responsable
       *
       * @param v new value
       */
      public void setResponsable(String v) 
      {
      
                    if (!ObjectUtils.equals(this.responsable, v))
                {
              this.responsable = v;
              setModified(true);
          }
      
            
                }
    
      /**
       * Get the VehiculoId
       *
       * @return int
       */
      public int getVehiculoId()
      {
          return vehiculoId;
      }
  
                                
      /**
       * Set the value of VehiculoId
       *
       * @param v new value
       */
      public void setVehiculoId(int v) throws TorqueException
      {
      
                    if (this.vehiculoId != v)
                {
              this.vehiculoId = v;
              setModified(true);
          }
      
                            
                  if (aVehiculo != null && !(aVehiculo.getId() == v))
                  {
              aVehiculo = null;
          }
        
                }
    
      /**
       * Get the Importe
       *
       * @return double
       */
      public double getImporte()
      {
          return importe;
      }
  
                          
      /**
       * Set the value of Importe
       *
       * @param v new value
       */
      public void setImporte(double v) 
      {
      
                    if (this.importe != v)
                {
              this.importe = v;
              setModified(true);
          }
      
            
                }
    
      /**
       * Get the Estado
       *
       * @return int
       */
      public int getEstado()
      {
          return estado;
      }
  
                          
      /**
       * Set the value of Estado
       *
       * @param v new value
       */
      public void setEstado(int v) 
      {
      
                    if (this.estado != v)
                {
              this.estado = v;
              setModified(true);
          }
      
            
                }
    
        
      
                    
      
          private Vehiculo aVehiculo;
  
      /**
       * Declares an association between this object and a Vehiculo object
       *
       * @param v Vehiculo
       * @throws TorqueException
       */
      public void setVehiculo(Vehiculo v) throws TorqueException
      {
              if (v == null)
          {
                            setVehiculoId( 0);
                }
          else
          {
              setVehiculoId(v.getId());
          }
              aVehiculo = v;
      }
  
                                              
      /**
       * Get the associated Vehiculo object
       *
       * @return the associated Vehiculo object
       * @throws TorqueException
       */
      public Vehiculo getVehiculo() throws TorqueException
      {
          if (aVehiculo == null && (this.vehiculoId != 0))
          {
                            aVehiculo = VehiculoPeer.retrieveByPK(SimpleKey.keyFor(this.vehiculoId));
                
              /* The following can be used instead of the line above to
                 guarantee the related object contains a reference
                 to this object, but this level of coupling
                 may be undesirable in many circumstances.
                 As it can lead to a db query with many results that may
                 never be used.
                 Vehiculo obj = VehiculoPeer.retrieveByPK(this.vehiculoId);
                 obj.addReparacions(this);
              */
          }
          return aVehiculo;
      }
  
      /**
       * Provides convenient way to set a relationship based on a
       * ObjectKey, for example
       * <code>bar.setFooKey(foo.getPrimaryKey())</code>
       *
           */
      public void setVehiculoKey(ObjectKey key) throws TorqueException
      {
        
                          setVehiculoId(((NumberKey) key).intValue());
                    }
         
                                  
              
        
      /**
       * If this collection has already been initialized, returns
       * the collection. Otherwise returns the results of
       * getOrdenTrabajos(new Criteria())
       *
       * @throws TorqueException
       */
      public List getOrdenTrabajos() throws TorqueException
      {
                    return getOrdenTrabajos(new Criteria(10));
            }
  
      /**
       * If this collection has already been initialized with
       * an identical criteria, it returns the collection.
       * Otherwise if this Reparacion has previously
       * been saved, it will retrieve related OrdenTrabajos from storage.
       * If this Reparacion is new, it will return
       * an empty collection or the current collection, the criteria
       * is ignored on a new object.
       *
       * @throws TorqueException
       */
      public List getOrdenTrabajos(Criteria criteria) throws TorqueException
      {
                              criteria.add(OrdenTrabajoPeer.REPARACION_ID, getId());
                              return OrdenTrabajoPeer.doSelect(criteria);
            }
  
      /**
       * If this collection has already been initialized, returns
       * the collection. Otherwise returns the results of
       * getOrdenTrabajos(new Criteria(),Connection)
       * This method takes in the Connection also as input so that
       * referenced objects can also be obtained using a Connection
       * that is taken as input
       */
      public List getOrdenTrabajos(Connection con) throws TorqueException
      {
                    return getOrdenTrabajos(new Criteria(10), con);
            }
  
      /**
       * If this collection has already been initialized with
       * an identical criteria, it returns the collection.
       * Otherwise if this Reparacion has previously
       * been saved, it will retrieve related OrdenTrabajos from storage.
       * If this Reparacion is new, it will return
       * an empty collection or the current collection, the criteria
       * is ignored on a new object.
       * This method takes in the Connection also as input so that
       * referenced objects can also be obtained using a Connection
       * that is taken as input
       */
      public List getOrdenTrabajos(Criteria criteria, Connection con)
              throws TorqueException
      {
                               criteria.add(OrdenTrabajoPeer.REPARACION_ID, getId());
                               return OrdenTrabajoPeer.doSelect(criteria, con);
             }
  
                          
                
                      
                                
                                  
                                                                
                                          
                      
                      
            
      /**
       * If this collection has already been initialized with
       * an identical criteria, it returns the collection.
       * Otherwise if this Reparacion is new, it will return
       * an empty collection; or if this Reparacion has previously
       * been saved, it will retrieve related OrdenTrabajos from storage.
       *
       * This method is protected by default in order to keep the public
       * api reasonable.  You can provide public methods for those you
       * actually need in Reparacion.
       */
      protected List getOrdenTrabajosJoinReparacion(Criteria criteria)
          throws TorqueException
      {
              
                          criteria.add(OrdenTrabajoPeer.REPARACION_ID, getId());
                                      return OrdenTrabajoPeer.doSelectJoinReparacion(criteria);
                  }
                    
                      
                      
                                  
                                                                
                                          
                      
                      
            
      /**
       * If this collection has already been initialized with
       * an identical criteria, it returns the collection.
       * Otherwise if this Reparacion is new, it will return
       * an empty collection; or if this Reparacion has previously
       * been saved, it will retrieve related OrdenTrabajos from storage.
       *
       * This method is protected by default in order to keep the public
       * api reasonable.  You can provide public methods for those you
       * actually need in Reparacion.
       */
      protected List getOrdenTrabajosJoinTrabajador(Criteria criteria)
          throws TorqueException
      {
              
                          criteria.add(OrdenTrabajoPeer.REPARACION_ID, getId());
                                      return OrdenTrabajoPeer.doSelectJoinTrabajador(criteria);
                  }
                              
  
  
                            
              
        
      /**
       * If this collection has already been initialized, returns
       * the collection. Otherwise returns the results of
       * getFacturass(new Criteria())
       *
       * @throws TorqueException
       */
      public List getFacturass() throws TorqueException
      {
                    return getFacturass(new Criteria(10));
            }
  
      /**
       * If this collection has already been initialized with
       * an identical criteria, it returns the collection.
       * Otherwise if this Reparacion has previously
       * been saved, it will retrieve related Facturass from storage.
       * If this Reparacion is new, it will return
       * an empty collection or the current collection, the criteria
       * is ignored on a new object.
       *
       * @throws TorqueException
       */
      public List getFacturass(Criteria criteria) throws TorqueException
      {
                              criteria.add(FacturasPeer.REPARACION_ID, getId());
                              return FacturasPeer.doSelect(criteria);
            }
  
      /**
       * If this collection has already been initialized, returns
       * the collection. Otherwise returns the results of
       * getFacturass(new Criteria(),Connection)
       * This method takes in the Connection also as input so that
       * referenced objects can also be obtained using a Connection
       * that is taken as input
       */
      public List getFacturass(Connection con) throws TorqueException
      {
                    return getFacturass(new Criteria(10), con);
            }
  
      /**
       * If this collection has already been initialized with
       * an identical criteria, it returns the collection.
       * Otherwise if this Reparacion has previously
       * been saved, it will retrieve related Facturass from storage.
       * If this Reparacion is new, it will return
       * an empty collection or the current collection, the criteria
       * is ignored on a new object.
       * This method takes in the Connection also as input so that
       * referenced objects can also be obtained using a Connection
       * that is taken as input
       */
      public List getFacturass(Criteria criteria, Connection con)
              throws TorqueException
      {
                               criteria.add(FacturasPeer.REPARACION_ID, getId());
                               return FacturasPeer.doSelect(criteria, con);
             }
  
                          
                
                      
                      
                                  
                                                                
                                          
                      
                      
            
      /**
       * If this collection has already been initialized with
       * an identical criteria, it returns the collection.
       * Otherwise if this Reparacion is new, it will return
       * an empty collection; or if this Reparacion has previously
       * been saved, it will retrieve related Facturass from storage.
       *
       * This method is protected by default in order to keep the public
       * api reasonable.  You can provide public methods for those you
       * actually need in Reparacion.
       */
      protected List getFacturassJoinCliente(Criteria criteria)
          throws TorqueException
      {
              
                          criteria.add(FacturasPeer.REPARACION_ID, getId());
                                      return FacturasPeer.doSelectJoinCliente(criteria);
                  }
                    
                      
                                
                                  
                                                                
                                          
                      
                      
            
      /**
       * If this collection has already been initialized with
       * an identical criteria, it returns the collection.
       * Otherwise if this Reparacion is new, it will return
       * an empty collection; or if this Reparacion has previously
       * been saved, it will retrieve related Facturass from storage.
       *
       * This method is protected by default in order to keep the public
       * api reasonable.  You can provide public methods for those you
       * actually need in Reparacion.
       */
      protected List getFacturassJoinReparacion(Criteria criteria)
          throws TorqueException
      {
              
                          criteria.add(FacturasPeer.REPARACION_ID, getId());
                                      return FacturasPeer.doSelectJoinReparacion(criteria);
                  }
                              
  
  
                            
              
        
      /**
       * If this collection has already been initialized, returns
       * the collection. Otherwise returns the results of
       * getPrestamos(new Criteria())
       *
       * @throws TorqueException
       */
      public List getPrestamos() throws TorqueException
      {
                    return getPrestamos(new Criteria(10));
            }
  
      /**
       * If this collection has already been initialized with
       * an identical criteria, it returns the collection.
       * Otherwise if this Reparacion has previously
       * been saved, it will retrieve related Prestamos from storage.
       * If this Reparacion is new, it will return
       * an empty collection or the current collection, the criteria
       * is ignored on a new object.
       *
       * @throws TorqueException
       */
      public List getPrestamos(Criteria criteria) throws TorqueException
      {
                              criteria.add(PrestamoPeer.REPARACION_ID, getId());
                              return PrestamoPeer.doSelect(criteria);
            }
  
      /**
       * If this collection has already been initialized, returns
       * the collection. Otherwise returns the results of
       * getPrestamos(new Criteria(),Connection)
       * This method takes in the Connection also as input so that
       * referenced objects can also be obtained using a Connection
       * that is taken as input
       */
      public List getPrestamos(Connection con) throws TorqueException
      {
                    return getPrestamos(new Criteria(10), con);
            }
  
      /**
       * If this collection has already been initialized with
       * an identical criteria, it returns the collection.
       * Otherwise if this Reparacion has previously
       * been saved, it will retrieve related Prestamos from storage.
       * If this Reparacion is new, it will return
       * an empty collection or the current collection, the criteria
       * is ignored on a new object.
       * This method takes in the Connection also as input so that
       * referenced objects can also be obtained using a Connection
       * that is taken as input
       */
      public List getPrestamos(Criteria criteria, Connection con)
              throws TorqueException
      {
                               criteria.add(PrestamoPeer.REPARACION_ID, getId());
                               return PrestamoPeer.doSelect(criteria, con);
             }
  
                          
                
                      
                      
                                  
                                                                
                                          
                      
                      
            
      /**
       * If this collection has already been initialized with
       * an identical criteria, it returns the collection.
       * Otherwise if this Reparacion is new, it will return
       * an empty collection; or if this Reparacion has previously
       * been saved, it will retrieve related Prestamos from storage.
       *
       * This method is protected by default in order to keep the public
       * api reasonable.  You can provide public methods for those you
       * actually need in Reparacion.
       */
      protected List getPrestamosJoinVehiculoCortesia(Criteria criteria)
          throws TorqueException
      {
              
                          criteria.add(PrestamoPeer.REPARACION_ID, getId());
                                      return PrestamoPeer.doSelectJoinVehiculoCortesia(criteria);
                  }
                    
                      
                                
                                  
                                                                
                                          
                      
                      
            
      /**
       * If this collection has already been initialized with
       * an identical criteria, it returns the collection.
       * Otherwise if this Reparacion is new, it will return
       * an empty collection; or if this Reparacion has previously
       * been saved, it will retrieve related Prestamos from storage.
       *
       * This method is protected by default in order to keep the public
       * api reasonable.  You can provide public methods for those you
       * actually need in Reparacion.
       */
      protected List getPrestamosJoinReparacion(Criteria criteria)
          throws TorqueException
      {
              
                          criteria.add(PrestamoPeer.REPARACION_ID, getId());
                                      return PrestamoPeer.doSelectJoinReparacion(criteria);
                  }
                              
  
  
            
      private static List fieldNames = null;
  
      /**
       * Generate a list of field names.
       *
       * @return a list of field names
       */
      public static synchronized List getFieldNames()
      {
          if (fieldNames == null)
          {
              fieldNames = new ArrayList();
                fieldNames.add("Id");
                fieldNames.add("Km");
                fieldNames.add("Deposito");
                fieldNames.add("FechaEntrada");
                fieldNames.add("FechaSalida");
                fieldNames.add("Obs");
                fieldNames.add("EstadoPrevio");
                fieldNames.add("Responsable");
                fieldNames.add("VehiculoId");
                fieldNames.add("Importe");
                fieldNames.add("Estado");
                fieldNames = Collections.unmodifiableList(fieldNames);
          }
          return fieldNames;
      }
  
      /**
       * Retrieves a field from the object by name passed in as a String.
       *
       * @param name field name
       * @return value
       */
      public Object getByName(String name)
      {
            if (name.equals("Id"))
          {
                  return new Integer(getId());
              }
            if (name.equals("Km"))
          {
                  return new Integer(getKm());
              }
            if (name.equals("Deposito"))
          {
                  return getDeposito();
              }
            if (name.equals("FechaEntrada"))
          {
                  return getFechaEntrada();
              }
            if (name.equals("FechaSalida"))
          {
                  return getFechaSalida();
              }
            if (name.equals("Obs"))
          {
                  return getObs();
              }
            if (name.equals("EstadoPrevio"))
          {
                  return getEstadoPrevio();
              }
            if (name.equals("Responsable"))
          {
                  return getResponsable();
              }
            if (name.equals("VehiculoId"))
          {
                  return new Integer(getVehiculoId());
              }
            if (name.equals("Importe"))
          {
                  return new Double(getImporte());
              }
            if (name.equals("Estado"))
          {
                  return new Integer(getEstado());
              }
            return null;
      }
  
      /**
       * Retrieves a field from the object by name passed in
       * as a String.  The String must be one of the static
       * Strings defined in this Class' Peer.
       *
       * @param name peer name
       * @return value
       */
      public Object getByPeerName(String name)
      {
            if (name.equals(ReparacionPeer.ID))
          {
  