1 18 19 package cowsultants.itracker.ejb.beans.entity; 20 21 import java.util.*; 22 import java.sql.Timestamp ; 23 24 import cowsultants.itracker.ejb.client.models.ReportModel; 25 26 public abstract class ReportBean extends GenericBean { 27 public abstract String getName(); 28 public abstract void setName(String value); 29 30 public abstract String getNameKey(); 31 public abstract void setNameKey(String value); 32 33 public abstract String getDescription(); 34 public abstract void setDescription(String value); 35 36 public abstract int getDataType(); 37 public abstract void setDataType(int value); 38 39 public abstract int getReportType(); 40 public abstract void setReportType(int value); 41 42 public abstract byte[] getFileData(); 43 public abstract void setFileData(byte[] value); 44 45 public abstract String getClassName(); 46 public abstract void setClassName(String value); 47 48 public ReportModel getModel() { 49 ReportModel model = new ReportModel(); 50 model.setId(this.getId()); 51 model.setName(this.getName()); 52 model.setNameKey(this.getNameKey()); 53 model.setDescription(this.getDescription()); 54 model.setDataType(this.getDataType()); 55 model.setReportType(this.getReportType()); 56 model.setClassName(this.getClassName()); 57 58 model.setLastModifiedDate(this.getLastModifiedDate()); 59 model.setCreateDate(this.getCreateDate()); 60 61 return model; 62 } 63 64 public void setModel(ReportModel model) { 65 this.setName(model.getName()); 66 this.setNameKey(model.getNameKey()); 67 this.setDescription(model.getDescription()); 68 this.setDataType(model.getDataType()); 69 this.setReportType(model.getReportType()); 70 this.setClassName(model.getClassName()); 71 72 if(model.getFileData().length > 0) { 73 this.setFileData(model.getFileData()); 74 } 75 76 this.setLastModifiedDate(new Timestamp (new Date().getTime())); 77 } 78 79 } | Popular Tags |