Я использую Slick 3.3.0 с Scala 2.12.8 и пользовательский метод def *
для класса с более чем 22 полями.Я все еще получаю too many elements for tuple: 23, allowed: 22
Что я делаю не так?
class DealerTable(tag: Tag) extends Table[Dealer](tag, "dealer") {
import CustomConverters._
def id = column[Int]("id", O.PrimaryKey, O.AutoInc)
def sellId = column[String]("sell_id", O.Unique)
def customerId = column[Int]("customer_id", O.Unique)
def fake = column[Boolean]("fake", O.Default(false))
def companyName = column[String]("company_name")
def district = column[String]("district")
def street = column[String]("street")
def postcode = column[String]("postcode")
def city = column[String]("city")
def country = column[Country]("country")
def firstName = column[String]("first_name")
def lastName = column[String]("last_name")
def gender = column[Option[Gender]]("gender")
def email = column[String]("email")
def phone = column[String]("phone")
def mobilePhone = column[String]("mobile_phone")
def subscriptionEndDate = column[Option[LocalDate]]("subscription_end_date")
def culture = column[Culture]("culture")
def rating = column[Float]("rating")
def minPrice = column[Option[Int]]("min_price")
def maxPrice = column[Option[Int]]("max_price")
def createdAt = column[ZonedDateTime]("created_at")
def updatedAt = column[ZonedDateTime]("updated_at")
def * =
(
id,
sellId,
customerId,
fake,
companyName,
district.?,
street,
postcode,
city,
country,
firstName,
lastName,
gender,
email,
phone,
mobilePhone.?,
subscriptionEndDate,
culture,
rating.?,
minPrice,
maxPrice,
createdAt.?,
updatedAt.?
) <> ((Dealer.apply _).tupled, Dealer.unapply)
}
final case class Dealer(id: Int,
sellId: String,
customerId: Int,
fake: Boolean = false,
companyName: String,
district: Option[String],
street: String,
postcode: String,
city: String,
country: Country,
firstName: String,
lastName: String,
gender: Option[Gender],
email: String,
phone: String,
mobilePhone: Option[String],
subscriptionEndDate: Option[LocalDate],
culture: Culture,
rating: Option[Float],
minPrice: Option[Int],
maxPrice: Option[Int],
createdAt: Option[ZonedDateTime] = None,
updatedAt: Option[ZonedDateTime] = None)