[英]Jooq (SQLite) not inserting
im trying to insert a new record in my table 我正在尝试在表中插入新记录
public void saveNewBook(ModelBook bookFilled) {
ModelBook book1 = create.newRecord("MyTableOfBooks", bookFilled); //in this part keep saying:
The method newRecord(Table, Object) in the type DSLContext is not applicable for the arguments (String, ModelBook) DSLContext类型的方法newRecord(Table,Object)不适用于参数(String,ModelBook)
but its the same way as this: http://www.jooq.org/doc/2.5/manual/sql-execution/fetching/pojos/ 但其方法与此相同: http : //www.jooq.org/doc/2.5/manual/sql-execution/fetching/pojos/
so i cant do the: 所以我做不到:
//book1.store();
}
The DSLContext.newRecord(Table, Object)
method takes a Table
reference as its first argument, not a string. DSLContext.newRecord(Table, Object)
方法将Table
引用作为其第一个参数,而不是字符串。 Ideally, you would pass a generated reference of your book table to that method. 理想情况下,您可以将生成的书表引用传递给该方法。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.