小编Deb*_*aul的帖子

显示方法的参数太多

我试图插入一些数据,apple_reportDB但我得到错误Too many arguments for method in the insert query

import scala.slick.driver.MysqlDriver.simple._

case class AppleReport(quantity:String,price:String,sale_amount:String)  

//tables
class Suppliers(tag: Tag)
  extends Table[AppleReport](tag, "apple_report") {

def quantity=column[String]("quantity")
def price=column[String]("price")
def sale_amount=column[String]("sale_amount")

def * =(quantity,price,sale_amount) <> (AffiliateReportFields.tupled,AffiliateReportFields.unapply)
}

   //declaring interface
val suppliers: TableQuery[Suppliers] = TableQuery[Suppliers]

val db=Database.forURL("jdbc:mysql://localhost:3306/apple_reportDB","root","",null, driver="com.mysql.jdbc.Driver")
  db.withSession { implicit session =>

//create table
suppliers.ddl.create
//Insert data
suppliers += ("apple","cow","cat")

  }
Run Code Online (Sandbox Code Playgroud)

scala slick-2.0

2
推荐指数
1
解决办法
4020
查看次数

如何从Map scala获取密钥而不管情况如何

如何在scala中实现相同的结果.

Map<String, Integer> lookup = 
    new TreeMap<String, Integer>(String.CASE_INSENSITIVE_ORDER);

lookup.put("One", 1);
lookup.put("tWo", 2);
lookup.put("thrEE", 3);

System.out.println(lookup.get("Two"));
System.out.println(lookup.get("three"));
Run Code Online (Sandbox Code Playgroud)

java scala

0
推荐指数
1
解决办法
94
查看次数

标签 统计

scala ×2

java ×1

slick-2.0 ×1