Show PedidoEJB.java syntax highlighted
package tk.sabreWulf.negest.entity.invoicing;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import com.finalist.util.log.LogService;
import com.finalist.util.log.Logger;
/**
* The Pedido entity bean.
*
* @author Jose Manuel Molina Pascual Sabre Wulf
* @version $Revision: 1.14 $, $Date: 2005/07/07 14:31:52 $
*/
@Table(name = "Pedido")
@Entity
public class PedidoEJB implements Serializable, PedidoIf {
/**
* The logger object.
*/
private static Logger log = LogService.getLogger(PedidoEJB.class);
private java.lang.Long id;
/**
* Default constructor.
*/
public PedidoEJB() {
}
/**
* Value object constructor.
*/
public PedidoEJB(tk.sabreWulf.negest.entity.invoicing.PedidoIf value) {
setId(value.getId());
}
/**
* 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>PedidoIf</code>
* @return the primary key for this Pedido
*/
public java.lang.Long create(tk.sabreWulf.negest.entity.invoicing.PedidoIf value) {
setId(value.getId());
// if (value.getId() == null) {
// value.setId(UniqueIdGenerator.getInstance().getLongId("Pedido"));
// }
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;
}
}
See more files for this project here