Show TOC

Syntax documentationEmployee Source Code Locate this document in the navigation structure

Syntax Syntax

  1. package com.sap.nwce.ra.sedm.ejb.entity;
    
    import java.io.Serializable;
    import java.math.BigDecimal;
    import java.util.ArrayList;
    import java.util.List;
    
    import javax.persistence.*;
    
    import static javax.persistence.GenerationType.TABLE;
    import static javax.persistence.FetchType.LAZY;
    
    /**
     * Entity implementation class for Entity: Employee
     *
     */
    @NamedQueries( {
    	@NamedQuery(name = "Employee.getAll", query = "SELECT e FROM Employee e"),
    	@NamedQuery(name = "Employee.findByNamePart", query = "SELECT e FROM Employee e WHERE e.lastName LIKE :namepart OR e.firstName LIKE :namepart1"),
    	@NamedQuery(name = "Employee.getById", query = "SELECT e FROM Employee e WHERE e.employeeId = :id")
    })
    
    @Entity
    @Table(name="EDM_EMPLOYEE")
    public class Employee implements Serializable {   
    
       @Id
       @TableGenerator(name="IdGenerator", table = "EDM_GENERATOR", pkColumnName = "BEAN_NAME", valueColumnName = "MAX_ID")
       @GeneratedValue(strategy=TABLE, generator = "IdGenerator")
       @Column(name="EMPLOYEE_ID")
       private int employeeId;   
       private String email;   
       private int salary;   
       private String salutation;
       @Version
       private int version;   
       private String lastName;   
       private String login;   
       private String firstName;
       @ManyToMany(fetch=LAZY, mappedBy = "employees")
       private List<Project> projectsByParticipant = new ArrayList<Project>();
    
    
       private static final long serialVersionUID = 1L;
    
       public Employee() {
    	 super();
       }   
       public int getEmployeeId() {
       	 return this.employeeId;
       }
    
       public void setEmployeeId(int employeeId) {
       	 this.employeeId = employeeId;
       }   
       public String getEmail() {
       	 return this.email;
       }
    
       public void setEmail(String email) {
       	 this.email = email;
       }   
       public int getSalary() {
       	 return this.salary;
       }
    
       public void setSalary(int salary) {
       	 this.salary = salary;
       }   
       public String getSalutation() {
       	 return this.salutation;
       }
    
       public void setSalutation(String salutation) {
       	 this.salutation = salutation;
       }   
       public int getVersion() {
       	 return this.version;
       }
    
       public void setVersion(int version) {
       	 this.version = version;
       }   
       public String getLastName() {
       	 return this.lastName;
       }
    
       public void setLastName(String lastName) {
       	 this.lastName = lastName;
       }   
       public String getLogin() {
       	 return this.login;
       }
    
       public void setLogin(String login) {
       	 this.login = login;
       }   
       public String getFirstName() {
       	 return this.firstName;
       }
    
       public void setFirstName(String firstName) {
       	 this.firstName = firstName;
       }
    
       public List<Project> getProjectsByParticipant() {
    	   return projectsByParticipant;
       }
    
       public void setProjectsByParticipant(List<Project> projectsByParticipant) {
    	   this.projectsByParticipant = projectsByParticipant;
       }
    
    }
    
End of the code.