package com.tyndalehouse.step.dataloader.beans; /** * Timeline bean represents the different timelines on which events can be found... * @author CJBurrell * */ public class TimelineBean extends DbBean { private final int timelineId; private final String timelineDescription; private final String timelineCode; public TimelineBean(int timelineId, String timelineDescription, String timelineCode) { this.timelineId = timelineId; this.timelineDescription = timelineDescription; this.timelineCode = timelineCode; } /** * @return the timelineId */ public int getTimelineId() { return timelineId; } /** * @return the timelineDescription */ public String getTimelineDescription() { return timelineDescription; } /** * @return the timelineCode */ public String getTimelineCode() { return timelineCode; } public String getInsertStatement() { StringBuffer statement = new StringBuffer(); statement.append("insert into step.timeband(timeband_id, timeband_code, timeband_description) values(") .append(getTimelineId()) .append(", ") .append(getDbString(getTimelineCode())) .append(", ") .append(getDbString(getTimelineDescription())) .append(");"); return statement.toString(); } /** * TODO: this is a bit hacky. make it with the own POJO * @return */ public String getSubTimebandInsertStatement() { StringBuffer statement = new StringBuffer(); statement.append("insert into step.sub_timeband(sub_timeband_id, sub_timeband_code, sub_timeband_description) values(") .append(getTimelineId()) .append(", ") .append(getDbString(getTimelineCode())) .append(", ") .append(getDbString(getTimelineDescription())) .append(");"); return statement.toString(); } }