DatoscobroEJB.java from Negest at Krugle
Show DatoscobroEJB.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 Datoscobro entity bean.
*
* @author Jose Manuel Molina Pascual Sabre Wulf
* @version $Revision: 1.14 $, $Date: 2005/07/07 14:31:52 $
*/
@Table(name = "DatosCobro")
@Entity
public class DatoscobroEJB implements Serializable, DatoscobroIf {
/**
* The logger object.
*/
private static Logger log = LogService.getLogger(DatoscobroEJB.class);
private ClienteEJB clienteidCliente;
private java.lang.Long id;
private java.lang.Byte obsoleto;
private java.lang.String cuentacorriente;
/**
* Default constructor.
*/
public DatoscobroEJB() {
}
/**
* Value object constructor.
*/
public DatoscobroEJB(tk.sabreWulf.negest.entity.customer.DatoscobroIf value) {
setId(value.getId());
setClienteid(value.getClienteid());
setObsoleto(value.getObsoleto());
setCuentacorriente(value.getCuentacorriente());
}
/**
* 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>DatoscobroIf</code>
* @return the primary key for this Datoscobro
*/
public java.lang.Long create(tk.sabreWulf.negest.entity.customer.DatoscobroIf value) {
setId(value.getId());
setObsoleto(value.getObsoleto());
setCuentacorriente(value.getCuentacorriente());
setClienteid(value.getClienteid());
// if (value.getId() == null) {
// value.setId(UniqueIdGenerator.getInstance().getLongId("Datoscobro"));
// }
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>cuentacorriente</code> property.
*
*/
@Column(name = "CuentaCorriente")
public java.lang.String getCuentacorriente() {
return cuentacorriente;
}
/**
* Sets the value of the <code>cuentacorriente</code> property.
*
* @param cuentacorriente the value for the <code>cuentacorriente</code> property
*/
public void setCuentacorriente(java.lang.String cuentacorriente) {
this.cuentacorriente = cuentacorriente;
}
/**
* 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