Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- case class JobTemplate(jtmId: Option[Int],
- srcId: Int,
- name: String,
- schedule: Option[String],
- timeZone: Option[String],
- extractionSQL: String,
- handler: Option[String],
- headerTemplate: Option[String],
- footerTemplate: Option[String],
- rowTemplate: Option[String],
- compressor: Option[String],
- filenameTemplates: Map[String, String],
- columnTypes: Map[String, String],
- paramValidators: Map[String, String],
- createdAt: DateTime,
- updatedAt: DateTime,
- isDeleted: Boolean) extends EditableEntity
- new JobTemplate(None, "Nielsen", 1, Some(schedule), Some(scheduleTz), selectStatement, Some("DLX"), Some(header), Some(footer), Some(row), Some("bzip2"), .... )
- case class JobTemplate(jtmId: Option[Int],
- srcId: Int,
- name: String,
- schedule: Option[Schedule],
- extractionSQL: String,
- outputData: OutputData,
- columnTypes: Map[String, String],
- paramValidators: Map[String, String],
- createdAt: DateTime,
- updatedAt: DateTime,
- isDeleted: Boolean) extends EditableEntity
- def toObject(row: Tuple17[Option[Int], String, Int, Option[String],
- Option[String], String, Option[String], Option[String], Option[String],
- Option[String], Option[String], Map[String, String],
- Map[String, String], Map[String, String], DateTime, DateTime, Boolean]): JobTemplate =
- row match {
- case (jtmId, name, srcId, schedule, timeZone, extractionSQL, handler,
- headerTemplate, footerTemplate, rowTemplate, compressor, filenameTemplates,
- columnTypes, paramValidators, createdAt, updatedAt, isDeleted) => {
- val outputData = new OutputData(handler, headerTemplate,
- footerTemplate, rowTemplate, compressor, filenameTemplates)
- val schedule = for {
- sh <- schedule
- tz <- timeZone
- } yield new Schedule(sh, tz)
- new JobTemplate(jtmId, name, srcId, schedule, extractionSQL, outputData,
- columnTypes, paramValidators, createdAt, updatedAt, isDeleted)
- }
- }
- val jobTemplate = new model.JobTemplate(
- jtmId = None,
- name = "Nielsen",
- srcId = 1,
- schedule = Some(schedule),
- timeZone = Some(scheduleTz),
- extractionSQL = selectStatement,
- handler = Some("DLX"),
- headerTemplate = Some(header),
- footerTemplate = Some(footer),
- rowTemplate = Some(row),
- compressor = Some("bzip2"),
- filenameTemplates = Map("log" -> logFileName, "meta" -> metaFileName),
- columnTypes = colTypes,
- paramValidators = parValidators,
- createdAt = now,
- updatedAt = now,
- isDeleted = ACTIVE.value)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement