DatosfactenvEJB.java from Negest at Krugle
Show DatosfactenvEJB.java syntax highlighted
package tk.sabreWulf.negest.entity.customer;
import java.io.Serializable;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import com.finalist.util.log.LogService;
import com.finalist.util.log.Logger;
/**
* The Datosfactenv entity bean.
*
* @author Jose Manuel Molina Pascual Sabre Wulf
* @version $Revision: 1.14 $, $Date: 2005/07/07 14:31:52 $
*/
@Table(name = "DatosFactEnv")
@Entity
public class DatosfactenvEJB implements Serializable, DatosfactenvIf {
/**
* The logger object.
*/
private static Logger log = LogService.getLogger(DatosfactenvEJB.class);
private ClienteEJB clienteidCliente;
private java.lang.Long id;
private java.lang.Byte obsoleto;
private java.lang.String direccion;
private java.lang.String cp;
private java.lang.String provincia;
private java.lang.String ciudad;
private java.lang.String observaciones;
/**
* Default constructor.
*/
public DatosfactenvEJB() {
}
/**
* Value object constructor.
*/
public DatosfactenvEJB(tk.sabreWulf.negest.entity.customer.DatosfactenvIf value) {
setId(value.getId());
setClienteid(value.getClienteid());
setObsoleto(value.getObsoleto());
setDireccion(value.getDireccion());
setCp(value.getCp());
setProvincia(value.getProvincia());
setCiudad(value.getCiudad());
setObservaciones(value.getObservaciones());
}
/**
* Creates a new entity bean and returns the primary key.
* If the primary key of the value object has been set, this key will be used.
* If the primary key is set to null, the UniqueId generator will be used to generate a primary key.
*
* @param value a <code>DatosfactenvIf</code>
* @return the primary key for this Datosfactenv
*/
public java.lang.Long create(tk.sabreWulf.negest.entity.customer.DatosfactenvIf value) {
setId(value.getId());
setObsoleto(value.getObsoleto());
setDireccion(value.getDireccion());
setCp(value.getCp());
setProvincia(value.getProvincia());
setCiudad(value.getCiudad());
setObservaciones(value.getObservaciones());
setClienteid(value.getClienteid());
// if (value.getId() == null) {
// value.setId(UniqueIdGenerator.getInstance().getLongId("Datosfactenv"));
// }
setId(value.getId());
return value.getPrimaryKey();
}
/**
* Return the primary key.
*
* @return java.lang.Long with the primary key.
*/
@javax.persistence.Transient
public java.lang.Long getPrimaryKey() {
return getId();
}
/**
* Set the primary key.
*
* @param primaryKey the primary key
*/
@javax.persistence.Transient
public void setPrimaryKey(java.lang.Long primaryKey) {
setId(primaryKey);
}
/**
* Returns the value of the <code>id</code> property.
*
*/
@Column(name = "id")
@Id @GeneratedValue
public java.lang.Long getId() {
return id;
}
/**
* Sets the value of the <code>id</code> property.
*
* @param id the value for the <code>id</code> property
*/
public void setId(java.lang.Long id) {
this.id = id;
}
/**
* Returns the value of the <code>obsoleto</code> property.
*
*/
@Column(name = "obsoleto")
public java.lang.Byte getObsoleto() {
return obsoleto;
}
/**
* Sets the value of the <code>obsoleto</code> property.
*
* @param obsoleto the value for the <code>obsoleto</code> property
*/
public void setObsoleto(java.lang.Byte obsoleto) {
this.obsoleto = obsoleto;
}
/**
* Returns the value of the <code>direccion</code> property.
*
*/
@Column(name = "Direccion")
public java.lang.String getDireccion() {
return direccion;
}
/**
* Sets the value of the <code>direccion</code> property.
*
* @param direccion the value for the <code>direccion</code> property
*/
public void setDireccion(java.lang.String direccion) {
this.direccion = direccion;
}
/**
* Returns the value of the <code>cp</code> property.
*
*/
@Column(name = "CP")
public java.lang.String getCp() {
return cp;
}
/**
* Sets the value of the <code>cp</code> property.
*
* @param cp the value for the <code>cp</code> property
*/
public void setCp(java.lang.String cp) {
this.cp = cp;
}
/**
* Returns the value of the <code>provincia</code> property.
*
*/
@Column(name = "Provincia")
public java.lang.String getProvincia() {
return provincia;
}
/**
* Sets the value of the <code>provincia</code> property.
*
* @param provincia the value for the <code>provincia</code> property
*/
public void setProvincia(java.lang.String provincia) {
this.provincia = provincia;
}
/**
* Returns the value of the <code>ciudad</code> property.
*
*/
@Column(name = "Ciudad")
public java.lang.String getCiudad() {
return ciudad;
}
/**
* Sets the value of the <code>ciudad</code> property.
*
* @param ciudad the value for the <code>ciudad</code> property
*/
public void setCiudad(java.lang.String ciudad) {
this.ciudad = ciudad;
}
/**
* Returns the value of the <code>observaciones</code> property.
*
*/
@Column(name = "Observaciones")
public java.lang.String getObservaciones() {
return observaciones;
}
/**
* Sets the value of the <code>observaciones</code> property.
*
* @param observaciones the value for the <code>observaciones</code> property
*/
public void setObservaciones(java.lang.String observaciones) {
this.observaciones = observaciones;
}
/**
* Returns the value of the <code>clienteidCliente</code> relation property.
*
* @return the value of the <code>clienteidCliente</code> relation property.
*/
@ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
@JoinColumn(name = "id")
public ClienteEJB getRelationClienteidCliente(){
return clienteidCliente;
}
/**
* Sets the value of the <code>clienteidCliente</code> relation property.
*
* @param cliente a value for <code>clienteidCliente</code>.
*/
public void setRelationClienteidCliente(ClienteEJB cliente) {
this. clienteidCliente = cliente;
}
/**
* Returns the value of the <code>clienteidCliente</code> relation property.
*
* @return the value of the <code>clienteidCliente</code> relation property.
*/
@javax.persistence.Transient
public ClienteIf getClienteidCliente() {
return getRelationClienteidCliente();
}
/**
* Sets the value of the <code>clienteidCliente</code> relation property.
*
* @param cliente a value for <code>clienteidCliente</code>.
*/
@javax.persistence.Transient
public void setClienteidCliente(ClienteIf cliente) {
setRelationClienteidCliente(new ClienteEJB(cliente));
}
/**
* Returns the value of the <code>id</code> property.
*
*/
@javax.persistence.Transient
public java.lang.Long getClienteid() {
if (clienteidCliente != null) {
return clienteidCliente.getId();
} else {
return null;
}
}
/**
* Sets the value of the <code>id</code> property.
*
* @param id the value for the <code>id</code> property
*/
@javax.persistence.Transient
public void setClienteid(java.lang.Long id) {
if (clienteidCliente == null) {
clienteidCliente = new ClienteEJB();
}
clienteidCliente.setId(id);
}
}
See more files for this project here