nutzam/nutz — Issue #121: 为自定义SQL的参数占位符设值,不支持列表、数组等类型
Author: conanca
Created: 2011-11-28 09:15:08+00:00
State: open

上代码:

long[] idArr = { 1, 2, 3 };
// 以下这句是OK的
query(Cnd.where("ID", "IN", idArr), null);
// 以下的代码报错
Sql sql = Sqls.create("SELECT * FROM PETS WHERE ID IN @idArr");
sql.params().set("idArr", idArr);
dao().execute(sql);

下面是报错信息
DEBUG org.nutz.dao.impl.sql.run.NutDaoExecutor - SELECT * FROM PETS WHERE ID IN '[J@a0560e'
Syntax error in SQL statement "SELECT * FROM PETS WHERE ID IN ?"; expected "("; SQL statement:

====================================================

Cnd的where()方法实现的很好啊，为什么自定义SQL的参数占位符设值不支持呢？