I am trying to insert into books table using jooq in java. books table has two columns book_id integer,jsonb_column jsonb. However the final query formed is not correct. The values for jsonb is not populated. This is my query formed.
insert into book (book_id, jsoncolumn) values (902, );
Below is my java code.
Field[] columnNames= new Field[2];
columnNames[0]=field("book_id");
columnNames[1]= field("jsoncolumn");
Field[] columnValues= new Field[2];
columnValues[0]=field("902");
columnValues[1]=field("{}");
Query query= create.insertInto(table("book"),
columnNames)
.values(columnValues);
String sql = query.getSQL();
System.out.println(sql);
How to go about this?