Package com.cin.dto

Source Code of com.cin.dto.JobDTO

/**
*
*/
package com.cin.dto;

import java.io.Serializable;

import com.cin.entity.Job;

/**
* @author arunsanjay
*
*/
public class JobDTO implements Serializable {
  private static final long serialVersionUID = 1L;

  private String workClass;
  private int industryCode;
  private int occupationCode;
  private String unionMember;
  private int employerSize;
  private int weekWage;
  private int selfEmployed;
  private int workWeeks;
 
  public JobDTO() {
   
  }
 
  // TODO this needs to be tested
  public JobDTO(Job pEntity) {
    this.setWorkClass( pEntity.getWorkclass() );
    if( pEntity.getIndustry() != null ){
      this.setIndustryCode( pEntity.getIndustry().getIndustrycode() );
    }
    if( pEntity.getOccupation() != null ){
      this.setOccupationCode( pEntity.getOccupation().getOccupationcode() );
    }
    this.setUnionMember( pEntity.getUnionmember() );
    this.setEmployerSize( pEntity.getEmployersize() );
    this.setWeekWage( pEntity.getWeekwage() );
    this.setSelfEmployed( pEntity.getSelfemployed() );
    this.setWorkWeeks(pEntity.getWorkweeks() );
  }
 
  public boolean isUnionMember() {
    if(this.getUnionMember() != null && this.getUnionMember().equalsIgnoreCase("yes")) {
     
      return true;
    }
    return false;
  }
 
  /**
   * @return the workClass
   */
  public String getWorkClass() {
    return workClass;
  }
  /**
   * @param workClass the workClass to set
   */
  public void setWorkClass(String workClass) {
    this.workClass = workClass;
  }
  /**
   * @return the industryCode
   */
  public int getIndustryCode() {
    return industryCode;
  }
  /**
   * @param industryCode the industryCode to set
   */
  public void setIndustryCode(int industryCode) {
    this.industryCode = industryCode;
  }
  /**
   * @return the occupationCode
   */
  public int getOccupationCode() {
    return occupationCode;
  }
  /**
   * @param occupationCode the occupationCode to set
   */
  public void setOccupationCode(int occupationCode) {
    this.occupationCode = occupationCode;
  }
  /**
   * @return the unionMember
   */
  public String getUnionMember() {
    return unionMember;
  }
  /**
   * @param unionMember the unionMember to set
   */
  public void setUnionMember(String unionMember) {
    this.unionMember = unionMember;
  }
  /**
   * @return the employerSize
   */
  public int getEmployerSize() {
    return employerSize;
  }
  /**
   * @param employerSize the employerSize to set
   */
  public void setEmployerSize(int employerSize) {
    this.employerSize = employerSize;
  }
  /**
   * @return the weekWage
   */
  public int getWeekWage() {
    return weekWage;
  }
  /**
   * @param weekWage the weekWage to set
   */
  public void setWeekWage(int weekWage) {
    this.weekWage = weekWage;
  }
  /**
   * @return the selfEmployed
   */
  public int getSelfEmployed() {
    return selfEmployed;
  }
  /**
   * @param selfEmployed the selfEmployed to set
   */
  public void setSelfEmployed(int selfEmployed) {
    this.selfEmployed = selfEmployed;
  }
  /**
   * @return the workWeeks
   */
  public int getWorkWeeks() {
    return workWeeks;
  }
  /**
   * @param workWeeks the workWeeks to set
   */
  public void setWorkWeeks(int workWeeks) {
    this.workWeeks = workWeeks;
  }
 
  public Job toEJB(int ssn){
    Job ejb = new Job();
    ejb.setEmployersize(employerSize);
    //ejb.setIndustry(null);
    //ejb.setOccupation(null);
    ejb.setSelfemployed(selfEmployed);
    ejb.setSsn(ssn);
    ejb.setUnionmember(unionMember);
    ejb.setWeekwage(weekWage);
    ejb.setWorkclass(workClass);
    ejb.setWorkweeks(workWeeks);
    return ejb;
  }
}
TOP

Related Classes of com.cin.dto.JobDTO

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.