All Downloads are FREE. Search and download functionalities are using the official Maven repository.

scalikejdbc.OneToManies7SQL.scala Maven / Gradle / Ivy

There is a newer version: 4.3.2
Show newest version
/*
 * Copyright 2013 - 2015 scalikejdbc.org
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
 * either express or implied. See the License for the specific language
 * governing permissions and limitations under the License.
 */
package scalikejdbc

import scala.collection.mutable.LinkedHashMap
import scala.collection.compat._

private[scalikejdbc] trait OneToManies7Extractor[A, B1, B2, B3, B4, B5, B6, B7, E <: WithExtractor, Z]
    extends SQL[Z, E]
    with RelationalSQLResultSetOperations[Z] {

  private[scalikejdbc] def extractOne: WrappedResultSet => A
  private[scalikejdbc] def extractTo1: WrappedResultSet => Option[B1]
  private[scalikejdbc] def extractTo2: WrappedResultSet => Option[B2]
  private[scalikejdbc] def extractTo3: WrappedResultSet => Option[B3]
  private[scalikejdbc] def extractTo4: WrappedResultSet => Option[B4]
  private[scalikejdbc] def extractTo5: WrappedResultSet => Option[B5]
  private[scalikejdbc] def extractTo6: WrappedResultSet => Option[B6]
  private[scalikejdbc] def extractTo7: WrappedResultSet => Option[B7]
  private[scalikejdbc] def transform: (A, scala.collection.Seq[B1], scala.collection.Seq[B2], scala.collection.Seq[B3], scala.collection.Seq[B4], scala.collection.Seq[B5], scala.collection.Seq[B6], scala.collection.Seq[B7]) => Z

  private[scalikejdbc] def processResultSet(result: (LinkedHashMap[A, (scala.collection.Seq[B1], scala.collection.Seq[B2], scala.collection.Seq[B3], scala.collection.Seq[B4], scala.collection.Seq[B5], scala.collection.Seq[B6], scala.collection.Seq[B7])]),
    rs: WrappedResultSet): LinkedHashMap[A, (scala.collection.Seq[B1], scala.collection.Seq[B2], scala.collection.Seq[B3], scala.collection.Seq[B4], scala.collection.Seq[B5], scala.collection.Seq[B6], scala.collection.Seq[B7])] = {
    val o = extractOne(rs)
    val (to1, to2, to3, to4, to5, to6, to7) = (extractTo1(rs), extractTo2(rs), extractTo3(rs), extractTo4(rs), extractTo5(rs), extractTo6(rs), extractTo7(rs))
    if (result.contains(o)) {
      (to1 orElse to2 orElse to3 orElse to4 orElse to5 orElse to6 orElse to7).map { _ =>
        val (ts1, ts2, ts3, ts4, ts5, ts6, ts7) = result.apply(o)
        result += (o -> ((
          to1.map(t => if (ts1.contains(t)) ts1 else ts1 :+ t).getOrElse(ts1),
          to2.map(t => if (ts2.contains(t)) ts2 else ts2 :+ t).getOrElse(ts2),
          to3.map(t => if (ts3.contains(t)) ts3 else ts3 :+ t).getOrElse(ts3),
          to4.map(t => if (ts4.contains(t)) ts4 else ts4 :+ t).getOrElse(ts4),
          to5.map(t => if (ts5.contains(t)) ts5 else ts5 :+ t).getOrElse(ts5),
          to6.map(t => if (ts6.contains(t)) ts6 else ts6 :+ t).getOrElse(ts6),
          to7.map(t => if (ts7.contains(t)) ts7 else ts7 :+ t).getOrElse(ts7)
        )))
      }.getOrElse(result)
    } else {
      result += (
        o -> ((
          to1.map(t => Vector(t)).getOrElse(Vector.empty),
          to2.map(t => Vector(t)).getOrElse(Vector.empty),
          to3.map(t => Vector(t)).getOrElse(Vector.empty),
          to4.map(t => Vector(t)).getOrElse(Vector.empty),
          to5.map(t => Vector(t)).getOrElse(Vector.empty),
          to6.map(t => Vector(t)).getOrElse(Vector.empty),
          to7.map(t => Vector(t)).getOrElse(Vector.empty)
        ))
      )
    }
  }

  private[scalikejdbc] def toIterable(session: DBSession, sql: String, params: scala.collection.Seq[?], zExtractor: (A, scala.collection.Seq[B1], scala.collection.Seq[B2], scala.collection.Seq[B3], scala.collection.Seq[B4], scala.collection.Seq[B5], scala.collection.Seq[B6], scala.collection.Seq[B7]) => Z): Iterable[Z] = {
    val attributesSwitcher = createDBSessionAttributesSwitcher
    DBSessionWrapper(session, attributesSwitcher).foldLeft(statement, rawParameters.toSeq*)(LinkedHashMap[A, (scala.collection.Seq[B1], scala.collection.Seq[B2], scala.collection.Seq[B3], scala.collection.Seq[B4], scala.collection.Seq[B5], scala.collection.Seq[B6], scala.collection.Seq[B7])]())(processResultSet).map {
      case (one, (t1, t2, t3, t4, t5, t6, t7)) => zExtractor(one, t1, t2, t3, t4, t5, t6, t7)
    }
  }

}

class OneToManies7SQL[A, B1, B2, B3, B4, B5, B6, B7, E <: WithExtractor, Z](
  override val statement: String,
  override val rawParameters: scala.collection.Seq[Any])(val one: WrappedResultSet => A)(val to1: WrappedResultSet => Option[B1], val to2: WrappedResultSet => Option[B2], val to3: WrappedResultSet => Option[B3], val to4: WrappedResultSet => Option[B4], val to5: WrappedResultSet => Option[B5], val to6: WrappedResultSet => Option[B6], val to7: WrappedResultSet => Option[B7])(val zExtractor: (A, scala.collection.Seq[B1], scala.collection.Seq[B2], scala.collection.Seq[B3], scala.collection.Seq[B4], scala.collection.Seq[B5], scala.collection.Seq[B6], scala.collection.Seq[B7]) => Z)
    extends SQL[Z, E](statement, rawParameters)(SQL.noExtractor[Z]("one-to-many extractor(one(RS => A).toManies(RS => Option[B1]...)) is specified, use #map((A,B) =>Z) instead."))
    with AllOutputDecisionsUnsupported[Z, E] {

  def map(zExtractor: (A, scala.collection.Seq[B1], scala.collection.Seq[B2], scala.collection.Seq[B3], scala.collection.Seq[B4], scala.collection.Seq[B5], scala.collection.Seq[B6], scala.collection.Seq[B7]) => Z): OneToManies7SQL[A, B1, B2, B3, B4, B5, B6, B7, HasExtractor, Z] = {
    val q: OneToManies7SQL[A, B1, B2, B3, B4, B5, B6, B7, HasExtractor, Z] = new OneToManies7SQL(statement, rawParameters)(one)(to1, to2, to3, to4, to5, to6, to7)(zExtractor)
    q.queryTimeout(queryTimeout)
    q.fetchSize(fetchSize)
    q.tags(tags.toSeq*)
    q
  }
  override def toIterable: OneToManies7SQLToIterable[A, B1, B2, B3, B4, B5, B6, B7, E, Z] = {
    val q: OneToManies7SQLToIterable[A, B1, B2, B3, B4, B5, B6, B7, E, Z] =new OneToManies7SQLToIterable[A, B1, B2, B3, B4, B5, B6, B7, E, Z](statement, rawParameters)(one)(to1, to2, to3, to4, to5, to6, to7)(zExtractor)
    q.queryTimeout(queryTimeout)
    q.fetchSize(fetchSize)
    q.tags(tags.toSeq*)
    q
  }
  override def toList: OneToManies7SQLToList[A, B1, B2, B3, B4, B5, B6, B7, E, Z] = {
    val q: OneToManies7SQLToList[A, B1, B2, B3, B4, B5, B6, B7, E, Z] = new OneToManies7SQLToList[A, B1, B2, B3, B4, B5, B6, B7, E, Z](statement, rawParameters)(one)(to1, to2, to3, to4, to5, to6, to7)(zExtractor)
    q.queryTimeout(queryTimeout)
    q.fetchSize(fetchSize)
    q.tags(tags.toSeq*)
    q
  }
  override def toOption: OneToManies7SQLToOption[A, B1, B2, B3, B4, B5, B6, B7, E, Z] = {
    val q: OneToManies7SQLToOption[A, B1, B2, B3, B4, B5, B6, B7, E, Z] = new OneToManies7SQLToOption[A, B1, B2, B3, B4, B5, B6, B7, E, Z](statement, rawParameters)(one)(to1, to2, to3, to4, to5, to6, to7)(zExtractor)(true)
    q.queryTimeout(queryTimeout)
    q.fetchSize(fetchSize)
    q.tags(tags.toSeq*)
    q
  }
  override def headOption: OneToManies7SQLToOption[A, B1, B2, B3, B4, B5, B6, B7, E, Z] = {
    val q: OneToManies7SQLToOption[A, B1, B2, B3, B4, B5, B6, B7, E, Z] = new OneToManies7SQLToOption[A, B1, B2, B3, B4, B5, B6, B7, E, Z](statement, rawParameters)(one)(to1, to2, to3, to4, to5, to6, to7)(zExtractor)(false)
    q.queryTimeout(queryTimeout)
    q.fetchSize(fetchSize)
    q.tags(tags.toSeq*)
    q
  }
  override def toCollection: OneToManies7SQLToCollection[A, B1, B2, B3, B4, B5, B6, B7, E, Z] = {
    val q: OneToManies7SQLToCollection[A, B1, B2, B3, B4, B5, B6, B7, E, Z] = new OneToManies7SQLToCollection[A, B1, B2, B3, B4, B5, B6, B7, E, Z](statement, rawParameters)(one)(to1, to2, to3, to4, to5, to6, to7)(zExtractor)
    q.queryTimeout(queryTimeout)
    q.fetchSize(fetchSize)
    q.tags(tags.toSeq*)
    q
  }

  override def single: OneToManies7SQLToOption[A, B1, B2, B3, B4, B5, B6, B7, E, Z] = toOption
  override def first: OneToManies7SQLToOption[A, B1, B2, B3, B4, B5, B6, B7, E, Z] = headOption
  override def list: OneToManies7SQLToList[A, B1, B2, B3, B4, B5, B6, B7, E, Z] = toList
  override def iterable: OneToManies7SQLToIterable[A, B1, B2, B3, B4, B5, B6, B7, E, Z] = toIterable
  override def collection: OneToManies7SQLToCollection[A, B1, B2, B3, B4, B5, B6, B7, E, Z] = toCollection
}

object OneToManies7SQL {
  def unapply[A, B1, B2, B3, B4, B5, B6, B7, E <: WithExtractor, Z](sqlObject: OneToManies7SQL[A, B1, B2, B3, B4, B5, B6, B7, E, Z]): Some[(String, scala.collection.Seq[Any], WrappedResultSet => A, (WrappedResultSet => Option[B1], WrappedResultSet => Option[B2], WrappedResultSet => Option[B3], WrappedResultSet => Option[B4], WrappedResultSet => Option[B5], WrappedResultSet => Option[B6], WrappedResultSet => Option[B7]), (A, scala.collection.Seq[B1], scala.collection.Seq[B2], scala.collection.Seq[B3], scala.collection.Seq[B4], scala.collection.Seq[B5], scala.collection.Seq[B6], scala.collection.Seq[B7]) => Z)] = {
    Some((sqlObject.statement, sqlObject.rawParameters, sqlObject.one, (sqlObject.to1, sqlObject.to2, sqlObject.to3, sqlObject.to4, sqlObject.to5, sqlObject.to6, sqlObject.to7), sqlObject.zExtractor))
  }
}

class OneToManies7SQLToList[A, B1, B2, B3, B4, B5, B6, B7, E <: WithExtractor, Z](
  override val statement: String,
  override val rawParameters: scala.collection.Seq[Any])(val one: WrappedResultSet => A)(val to1: WrappedResultSet => Option[B1], val to2: WrappedResultSet => Option[B2], val to3: WrappedResultSet => Option[B3], val to4: WrappedResultSet => Option[B4], val to5: WrappedResultSet => Option[B5], val to6: WrappedResultSet => Option[B6], val to7: WrappedResultSet => Option[B7])(val zExtractor: (A, scala.collection.Seq[B1], scala.collection.Seq[B2], scala.collection.Seq[B3], scala.collection.Seq[B4], scala.collection.Seq[B5], scala.collection.Seq[B6], scala.collection.Seq[B7]) => Z)
    extends SQL[Z, E](statement, rawParameters)(SQL.noExtractor[Z]("one-to-many extractor(one(RS => A).toManies(RS => Option[B1])) is specified, use #map((A,B) =>Z) instead."))
    with SQLToList[Z, E]
    with AllOutputDecisionsUnsupported[Z, E]
    with OneToManies7Extractor[A, B1, B2, B3, B4, B5, B6, B7, E, Z] {

  import GeneralizedTypeConstraintsForWithExtractor._

  override def apply()(implicit session: DBSession, context: ConnectionPoolContext = NoConnectionPoolContext, hasExtractor: ThisSQL =:= SQLWithExtractor): List[Z] = {
    executeQuery[List](session, (session: DBSession) => toIterable(session, statement, rawParameters, zExtractor).toList)
  }

  private[scalikejdbc] def extractOne: WrappedResultSet => A = one
  private[scalikejdbc] def extractTo1: WrappedResultSet => Option[B1] = to1
  private[scalikejdbc] def extractTo2: WrappedResultSet => Option[B2] = to2
  private[scalikejdbc] def extractTo3: WrappedResultSet => Option[B3] = to3
  private[scalikejdbc] def extractTo4: WrappedResultSet => Option[B4] = to4
  private[scalikejdbc] def extractTo5: WrappedResultSet => Option[B5] = to5
  private[scalikejdbc] def extractTo6: WrappedResultSet => Option[B6] = to6
  private[scalikejdbc] def extractTo7: WrappedResultSet => Option[B7] = to7
  private[scalikejdbc] def transform: (A, scala.collection.Seq[B1], scala.collection.Seq[B2], scala.collection.Seq[B3], scala.collection.Seq[B4], scala.collection.Seq[B5], scala.collection.Seq[B6], scala.collection.Seq[B7]) => Z = zExtractor
}

object OneToManies7SQLToList {
  def unapply[A, B1, B2, B3, B4, B5, B6, B7, E <: WithExtractor, Z](sqlObject: OneToManies7SQLToList[A, B1, B2, B3, B4, B5, B6, B7, E, Z]): Some[(String, scala.collection.Seq[Any], WrappedResultSet => A, (WrappedResultSet => Option[B1], WrappedResultSet => Option[B2], WrappedResultSet => Option[B3], WrappedResultSet => Option[B4], WrappedResultSet => Option[B5], WrappedResultSet => Option[B6], WrappedResultSet => Option[B7]), (A, scala.collection.Seq[B1], scala.collection.Seq[B2], scala.collection.Seq[B3], scala.collection.Seq[B4], scala.collection.Seq[B5], scala.collection.Seq[B6], scala.collection.Seq[B7]) => Z)] = {
    Some((sqlObject.statement, sqlObject.rawParameters, sqlObject.one, (sqlObject.to1, sqlObject.to2, sqlObject.to3, sqlObject.to4, sqlObject.to5, sqlObject.to6, sqlObject.to7), sqlObject.zExtractor))
  }
}

final class OneToManies7SQLToCollection[A, B1, B2, B3, B4, B5, B6, B7, E <: WithExtractor, Z] private[scalikejdbc](
  override val statement: String,
  override val rawParameters: scala.collection.Seq[Any])(val one: WrappedResultSet => A)(val to1: WrappedResultSet => Option[B1], val to2: WrappedResultSet => Option[B2], val to3: WrappedResultSet => Option[B3], val to4: WrappedResultSet => Option[B4], val to5: WrappedResultSet => Option[B5], val to6: WrappedResultSet => Option[B6], val to7: WrappedResultSet => Option[B7])(val zExtractor: (A, scala.collection.Seq[B1], scala.collection.Seq[B2], scala.collection.Seq[B3], scala.collection.Seq[B4], scala.collection.Seq[B5], scala.collection.Seq[B6], scala.collection.Seq[B7]) => Z)
    extends SQL[Z, E](statement, rawParameters)(SQL.noExtractor[Z]("one-to-many extractor(one(RS => A).toManies(RS => Option[B1])) is specified, use #map((A,B) =>Z) instead."))
    with SQLToCollection[Z, E]
    with AllOutputDecisionsUnsupported[Z, E]
    with OneToManies7Extractor[A, B1, B2, B3, B4, B5, B6, B7, E, Z] {

  import GeneralizedTypeConstraintsForWithExtractor._

  override def apply[C[_]]()(implicit session: DBSession, context: ConnectionPoolContext = NoConnectionPoolContext, hasExtractor: ThisSQL =:= SQLWithExtractor, f: Factory[Z, C[Z]]): C[Z] = {
    executeQuery(session, (session: DBSession) => f.fromSpecific(toIterable(session, statement, rawParameters, zExtractor)))
  }

  private[scalikejdbc] def extractOne: WrappedResultSet => A = one
  private[scalikejdbc] def extractTo1: WrappedResultSet => Option[B1] = to1
  private[scalikejdbc] def extractTo2: WrappedResultSet => Option[B2] = to2
  private[scalikejdbc] def extractTo3: WrappedResultSet => Option[B3] = to3
  private[scalikejdbc] def extractTo4: WrappedResultSet => Option[B4] = to4
  private[scalikejdbc] def extractTo5: WrappedResultSet => Option[B5] = to5
  private[scalikejdbc] def extractTo6: WrappedResultSet => Option[B6] = to6
  private[scalikejdbc] def extractTo7: WrappedResultSet => Option[B7] = to7
  private[scalikejdbc] def transform: (A, scala.collection.Seq[B1], scala.collection.Seq[B2], scala.collection.Seq[B3], scala.collection.Seq[B4], scala.collection.Seq[B5], scala.collection.Seq[B6], scala.collection.Seq[B7]) => Z = zExtractor
}

object OneToManies7SQLToCollection {
  def unapply[A, B1, B2, B3, B4, B5, B6, B7, E <: WithExtractor, Z](sqlObject: OneToManies7SQLToCollection[A, B1, B2, B3, B4, B5, B6, B7, E, Z]): Some[(String, scala.collection.Seq[Any], WrappedResultSet => A, (WrappedResultSet => Option[B1], WrappedResultSet => Option[B2], WrappedResultSet => Option[B3], WrappedResultSet => Option[B4], WrappedResultSet => Option[B5], WrappedResultSet => Option[B6], WrappedResultSet => Option[B7]), (A, scala.collection.Seq[B1], scala.collection.Seq[B2], scala.collection.Seq[B3], scala.collection.Seq[B4], scala.collection.Seq[B5], scala.collection.Seq[B6], scala.collection.Seq[B7]) => Z)] = {
    Some((sqlObject.statement, sqlObject.rawParameters, sqlObject.one, (sqlObject.to1, sqlObject.to2, sqlObject.to3, sqlObject.to4, sqlObject.to5, sqlObject.to6, sqlObject.to7), sqlObject.zExtractor))
  }
}

class OneToManies7SQLToIterable[A, B1, B2, B3, B4, B5, B6, B7, E <: WithExtractor, Z](
  override val statement: String,
  override val rawParameters: scala.collection.Seq[Any])(val one: WrappedResultSet => A)(val to1: WrappedResultSet => Option[B1], val to2: WrappedResultSet => Option[B2], val to3: WrappedResultSet => Option[B3], val to4: WrappedResultSet => Option[B4], val to5: WrappedResultSet => Option[B5], val to6: WrappedResultSet => Option[B6], val to7: WrappedResultSet => Option[B7])(val zExtractor: (A, scala.collection.Seq[B1], scala.collection.Seq[B2], scala.collection.Seq[B3], scala.collection.Seq[B4], scala.collection.Seq[B5], scala.collection.Seq[B6], scala.collection.Seq[B7]) => Z)
    extends SQL[Z, E](statement, rawParameters)(SQL.noExtractor[Z]("one-to-many extractor(one(RS => A).toMany(RS => Option[B1])) is specified, use #map((A,B) =>Z) instead."))
    with SQLToIterable[Z, E]
    with AllOutputDecisionsUnsupported[Z, E]
    with OneToManies7Extractor[A, B1, B2, B3, B4, B5, B6, B7, E, Z] {

  import GeneralizedTypeConstraintsForWithExtractor._

  override def apply()(implicit session: DBSession, context: ConnectionPoolContext = NoConnectionPoolContext, hasExtractor: ThisSQL =:= SQLWithExtractor): Iterable[Z] = {
    executeQuery[Iterable](session, (session: DBSession) => toIterable(session, statement, rawParameters, zExtractor))
  }

  private[scalikejdbc] def extractOne: WrappedResultSet => A = one
  private[scalikejdbc] def extractTo1: WrappedResultSet => Option[B1] = to1
  private[scalikejdbc] def extractTo2: WrappedResultSet => Option[B2] = to2
  private[scalikejdbc] def extractTo3: WrappedResultSet => Option[B3] = to3
  private[scalikejdbc] def extractTo4: WrappedResultSet => Option[B4] = to4
  private[scalikejdbc] def extractTo5: WrappedResultSet => Option[B5] = to5
  private[scalikejdbc] def extractTo6: WrappedResultSet => Option[B6] = to6
  private[scalikejdbc] def extractTo7: WrappedResultSet => Option[B7] = to7
  private[scalikejdbc] def transform: (A, scala.collection.Seq[B1], scala.collection.Seq[B2], scala.collection.Seq[B3], scala.collection.Seq[B4], scala.collection.Seq[B5], scala.collection.Seq[B6], scala.collection.Seq[B7]) => Z = zExtractor
}

object OneToManies7SQLToIterable {
  def unapply[A, B1, B2, B3, B4, B5, B6, B7, E <: WithExtractor, Z](sqlObject: OneToManies7SQLToIterable[A, B1, B2, B3, B4, B5, B6, B7, E, Z]): Some[(String, scala.collection.Seq[Any], WrappedResultSet => A, (WrappedResultSet => Option[B1], WrappedResultSet => Option[B2], WrappedResultSet => Option[B3], WrappedResultSet => Option[B4], WrappedResultSet => Option[B5], WrappedResultSet => Option[B6], WrappedResultSet => Option[B7]), (A, scala.collection.Seq[B1], scala.collection.Seq[B2], scala.collection.Seq[B3], scala.collection.Seq[B4], scala.collection.Seq[B5], scala.collection.Seq[B6], scala.collection.Seq[B7]) => Z)] = {
    Some((sqlObject.statement, sqlObject.rawParameters, sqlObject.one, (sqlObject.to1, sqlObject.to2, sqlObject.to3, sqlObject.to4, sqlObject.to5, sqlObject.to6, sqlObject.to7), sqlObject.zExtractor))
  }
}

class OneToManies7SQLToOption[A, B1, B2, B3, B4, B5, B6, B7, E <: WithExtractor, Z](
  override val statement: String,
  override val rawParameters: scala.collection.Seq[Any])(val one: WrappedResultSet => A)(val to1: WrappedResultSet => Option[B1], val to2: WrappedResultSet => Option[B2], val to3: WrappedResultSet => Option[B3], val to4: WrappedResultSet => Option[B4], val to5: WrappedResultSet => Option[B5], val to6: WrappedResultSet => Option[B6], val to7: WrappedResultSet => Option[B7])(val zExtractor: (A, scala.collection.Seq[B1], scala.collection.Seq[B2], scala.collection.Seq[B3], scala.collection.Seq[B4], scala.collection.Seq[B5], scala.collection.Seq[B6], scala.collection.Seq[B7]) => Z)(val isSingle: Boolean = true)
    extends SQL[Z, E](statement, rawParameters)(SQL.noExtractor[Z]("one-to-many extractor(one(RS => A).toMany(RS => Option[B1])) is specified, use #map((A,B) =>Z) instead."))
    with SQLToOption[Z, E]
    with AllOutputDecisionsUnsupported[Z, E]
    with OneToManies7Extractor[A, B1, B2, B3, B4, B5, B6, B7, E, Z] {

  import GeneralizedTypeConstraintsForWithExtractor._
  override def apply()(implicit session: DBSession, context: ConnectionPoolContext = NoConnectionPoolContext, hasExtractor: ThisSQL =:= SQLWithExtractor): Option[Z] = {
    executeQuery[Option](session, (session: DBSession) => toSingle(toIterable(session, statement, rawParameters, zExtractor)))
  }

  private[scalikejdbc] def extractOne: WrappedResultSet => A = one
  private[scalikejdbc] def extractTo1: WrappedResultSet => Option[B1] = to1
  private[scalikejdbc] def extractTo2: WrappedResultSet => Option[B2] = to2
  private[scalikejdbc] def extractTo3: WrappedResultSet => Option[B3] = to3
  private[scalikejdbc] def extractTo4: WrappedResultSet => Option[B4] = to4
  private[scalikejdbc] def extractTo5: WrappedResultSet => Option[B5] = to5
  private[scalikejdbc] def extractTo6: WrappedResultSet => Option[B6] = to6
  private[scalikejdbc] def extractTo7: WrappedResultSet => Option[B7] = to7
  private[scalikejdbc] def transform: (A, scala.collection.Seq[B1], scala.collection.Seq[B2], scala.collection.Seq[B3], scala.collection.Seq[B4], scala.collection.Seq[B5], scala.collection.Seq[B6], scala.collection.Seq[B7]) => Z = zExtractor
}

object OneToManies7SQLToOption {
  def unapply[A, B1, B2, B3, B4, B5, B6, B7, E <: WithExtractor, Z](sqlObject: OneToManies7SQLToOption[A, B1, B2, B3, B4, B5, B6, B7, E, Z]): Some[(String, scala.collection.Seq[Any], WrappedResultSet => A, (WrappedResultSet => Option[B1], WrappedResultSet => Option[B2], WrappedResultSet => Option[B3], WrappedResultSet => Option[B4], WrappedResultSet => Option[B5], WrappedResultSet => Option[B6], WrappedResultSet => Option[B7]), (A, scala.collection.Seq[B1], scala.collection.Seq[B2], scala.collection.Seq[B3], scala.collection.Seq[B4], scala.collection.Seq[B5], scala.collection.Seq[B6], scala.collection.Seq[B7]) => Z, Boolean)] = {
    Some((sqlObject.statement, sqlObject.rawParameters, sqlObject.one, (sqlObject.to1, sqlObject.to2, sqlObject.to3, sqlObject.to4, sqlObject.to5, sqlObject.to6, sqlObject.to7), sqlObject.zExtractor, sqlObject.isSingle))
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy