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.CustomFieldValueModel; 25 26 public abstract class CustomFieldValueBean extends GenericBean { 27 28 public abstract String getValue(); 29 public abstract void setValue(String value); 30 31 public abstract int getSortOrder(); 32 public abstract void setSortOrder(int value); 33 34 public abstract CustomFieldLocal getCustomField(); 35 public abstract void setCustomField(CustomFieldLocal values); 36 37 public CustomFieldValueModel getModel() { 38 CustomFieldValueModel model = new CustomFieldValueModel(); 39 model.setId(this.getId()); 40 model.setValue(this.getValue()); 41 model.setSortOrder(this.getSortOrder()); 42 model.setCustomFieldId((this.getCustomField() == null ? new Integer (-1) : this.getCustomField().getId())); 43 model.setLastModifiedDate(this.getLastModifiedDate()); 44 model.setCreateDate(this.getCreateDate()); 45 46 return model; 47 } 48 49 public void setModel(CustomFieldValueModel model) { 50 this.setValue(model.getValue()); 51 this.setSortOrder(model.getSortOrder()); 52 this.setLastModifiedDate(new Timestamp (new Date().getTime())); 53 } 54 55 } 56 | Popular Tags |