我试图执行插入但我收到此异常:
Caused by: java.lang.RuntimeException: TypeDoesNotMatch(Cannot convert 7:
class java.math.BigDecimal to Long for column ColumnName(.GENERATED_KEYS,Some(GENERATED_KEYS)))
我的插页有什么问题?
def insertImportedFile(bean:Bean) : Option[Long] = {
DB.withConnection("conn") { implicit connection =>
val sqlQuery = SQL(
"""
INSERT INTO Persons (name, group, dateCreated)
VALUES ({name}, {group}, {dateCreated}, )
"""
).on(
"name" -> bean.name,
"group" -> bean.group,
"dateCreated" -> new Date
).executeInsert()
return sqlQuery
}
}
提前感谢。