Code Search for Developers
 
 
  

EventoEJB.java from Negest at Krugle


Show EventoEJB.java syntax highlighted

package tk.sabreWulf.negest.entity.core;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.Table;

import tk.sabreWulf.negest.entity.security.UsuarioEJB;

//import com.finalist.util.log.LogService;
//import com.finalist.util.log.Logger;

/**
 * The Evento entity bean.
 *
 * @author  Jose Manuel Molina Pascual  Sabre Wulf
 * @version $Revision: 1.14 $, $Date: 2005/07/07 14:31:52 $
 */
@Table(name = "Evento")
@Entity
public class EventoEJB implements Serializable, EventoIf {

   /**
    * The logger object.
    */
   //private static Logger log = LogService.getLogger(EventoEJB.class);


//   @Inject
//   private EntityManager manager;

   private java.lang.Long id;
   private java.lang.String descripcion;
   private java.lang.String observaciones;
   private java.lang.Double cantidad;
   private Collection <UsuarioEJB> users = new ArrayList<UsuarioEJB> ();

   /**
    * Default constructor.
    */
   public EventoEJB() {
   }

   /**
    * Value object constructor.
    */
   public EventoEJB(tk.sabreWulf.negest.entity.core.EventoIf value) {
      setId(value.getId());
      setDescripcion(value.getDescripcion());
   }

   /**
    * 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>EventoIf</code>
    * @return the primary key for this Evento
    */
   public java.lang.Long create(tk.sabreWulf.negest.entity.core.EventoIf value) {
      setId(value.getId());
      setDescripcion(value.getDescripcion());
//      if (value.getId() == null) {
//         value.setId(UniqueIdGenerator.getInstance().getLongId("Evento"));
//      }
      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>descripcion</code> property.
    *
    */
   @Column(name = "descripcion")
   public java.lang.String getDescripcion() {
      return descripcion;
   }

   /**
    * Sets the value of the <code>descripcion</code> property.
    *
    * @param descripcion the value for the <code>descripcion</code> property
    */
   public void setDescripcion(java.lang.String descripcion) {
      this.descripcion = descripcion;
   }
   
   /**
    * 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>cantidad</code> property.
    *
    */
   @Column(name = "cantidad")
   public java.lang.Double getCantidad() {
      return cantidad;
   }

   /**
    * Sets the value of the <code>cantidad</code> property.
    *
    * @param cantidad the value for the <code>cantidad</code> property
    */
   public void setCantidad(java.lang.Double cantidad) {
      this.cantidad = cantidad;
   }
   
   @ManyToMany (targetEntity=UsuarioEJB.class, mappedBy = "documents")
   public Collection<UsuarioEJB> getUsers(){
	   return this.users;
   }
   public void setUsers(Collection <UsuarioEJB> users){
	   this.users = users;
   }
}




See more files for this project here

Negest

This project aims to offer the SOHO integrated platform to track their customers, the events generated by/with them, the orders and billing, warehouses, customer locations and equipment. Its a CMP/ERP, with its focus on water treatment business, for this

Project homepage: http://sourceforge.net/projects/negest
Programming language(s): Java,XML
License: other

  CentroEJB.java
  DocumentoEJB.java
  EmpresaEJB.java
  EventoEJB.java
  MediopagoEJB.java
  PlazopagoEJB.java
  SedeEJB.java
  UtilEJB.java