Mysql queries are normal in the database, but errors are reported in java

select I. I. ID. I. Price. I. Amount. Name from orderitem i, goods g where order_id =? And i.goods_id = g.id
java.sql.SQLException: Cannot create com.yanzi.model.OrderItem: com.yanzi.model.OrderItem Query: select I.id from orderitem i, goods g where order_id i.priceMagi i.amount from orderitem i, goods g where order_id =? And i.goods_id = g.id Parameters: [9]

public List<OrderItem> selectAllItem(int orderid) throws SQLException {
    QueryRunner r = new QueryRunner(DBUtil.getDataSource());        
    String sql = "select i.id,i.price,i.amount,g.name from orderitem i ,goods g where order_id = ? and i.goods_id = g.id";
    System.out.println(sql);
    return r.query(sql, new BeanListHandler<OrderItem>(OrderItem.class),orderid);
}
Feb.14,2022

Cannot create com.yanzi.model.OrderItem
isn't the error obvious?

Menu