-
-
Save wjur/93712a51d392d181ab7fc2408e4ce48b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case class AuditResultLightLifted( | |
ProcessorId: Rep[Long], | |
DispatchedTimestamp: Rep[Timestamp], | |
IsSuccessful: Rep[Boolean], | |
AuditResultId: Rep[Long] | |
) | |
case class AuditResultLight( | |
ProcessorId: Long, | |
DispatchedTimestamp: Timestamp, | |
IsSuccessful: Boolean, | |
AuditResultId: Long = 0L | |
) | |
implicit object AuditResultLightShape | |
extends CaseClassShape(AuditResultLightLifted.tupled, AuditResultLight.tupled) | |
class AuditResultTable(tag: Tag) extends Table[AuditResult](tag, AuditResultTableName) { | |
def auditResultId: Rep[Long] = column[Long]("AuditResultId", O.PrimaryKey, O.AutoInc) | |
def processorId: Rep[Long] = column[Long]("ProcessorId") | |
def dispatchedTimestamp: Rep[Timestamp] = column[Timestamp]("DispatchedTimestamp", O.SqlType("timestamp(2)")) | |
def SystemAOutput: Rep[Array[Byte]] = column[Array[Byte]]("SystemAOutput", O.SqlType("LONGBLOB")) | |
def SystemBOutput: Rep[Array[Byte]] = column[Array[Byte]]("SystemBOutput", O.SqlType("LONGBLOB")) | |
def isSuccessful: Rep[Boolean] = column[Boolean]("IsSuccessful") | |
def * : ProvenShape[AuditResult] = (processorId, dispatchedTimestamp, systemAOutput, systemBOutput, isSuccessful, auditResultId) <> | |
(AuditResult.tupled, AuditResult.unapply) | |
} | |
val auditResults = TableQuery[AuditResultTable] | |
val auditResultsLight = auditResults.map(r => AuditResultLightLifted(r.ProcessorId, r.DispatchedTimestamp, r.IsSuccessful, r.AuditResultId)) | |
def getRecentFailedAuditsQuery(): Query[AuditResultTable, AuditResultLight, Seq] = { | |
auditResultsLight.filterNot(r => r.isSuccessful) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
could you please append the exentsion
.scala
? just to have a better syntax highlighting? thanks.