mirror of
https://github.com/ysoftdevs/odc-analyzer.git
synced 2026-03-18 07:14:26 +01:00
Adapt for new version of ODC database
This commit is contained in:
@@ -9,12 +9,12 @@ import slick.jdbc.JdbcType
|
||||
import scala.reflect.ClassTag
|
||||
|
||||
// TODO: consider renaming to CpeEntryVulnerability or something like that
|
||||
final case class SoftwareVulnerability (vulnerabilityId: Int, cpeEntryId: Int, includesAllPreviousVersionsRaw: Option[String]){
|
||||
def includesAllPreviousVersions: Boolean = includesAllPreviousVersionsRaw match {
|
||||
case Some("1") => true
|
||||
case None => false
|
||||
case _ => sys.error("Unexpected value from ODC database")
|
||||
}
|
||||
final case class SoftwareVulnerability (vulnerabilityId: Int, cpeEntryId: Int/*, includesAllPreviousVersionsRaw: Option[String]*/){
|
||||
// def includesAllPreviousVersions: Boolean = includesAllPreviousVersionsRaw match {
|
||||
// case Some("1") => true
|
||||
// case None => false
|
||||
// case _ => sys.error("Unexpected value from ODC database")
|
||||
// }
|
||||
}
|
||||
|
||||
/*private class OdcBooleanType(implicit t: JdbcType[Option[String]]) extends MappedJdbcType[Boolean, Option[String]] {
|
||||
@@ -35,6 +35,6 @@ class SoftwareVulnerabilities(tag: Tag) extends Table[SoftwareVulnerability](tag
|
||||
def cpeEntryId = column[Int]("cpeentryid")
|
||||
//private val bt = new OdcBooleanType()(jdbcTypeFor(implicitly[BaseColumnType[String]].optionType).asInstanceOf[JdbcType[Option[String]]])
|
||||
//MappedJdbcType.base[Boolean, Option[String]](???, ???)(implicitly[ClassTag[Boolean]], )
|
||||
def includesAllPreviousVersionsRaw = column[String]("previousversion").?
|
||||
def * = (vulnerabilityId, cpeEntryId, includesAllPreviousVersionsRaw) <> (SoftwareVulnerability.tupled, SoftwareVulnerability.unapply)
|
||||
//def includesAllPreviousVersionsRaw = column[String]("previousversion").?
|
||||
def * = (vulnerabilityId, cpeEntryId/*, includesAllPreviousVersionsRaw*/) <> (SoftwareVulnerability.tupled, SoftwareVulnerability.unapply)
|
||||
}
|
||||
Reference in New Issue
Block a user