Ignite 如何为loadcache指定sql参数

Ignite 如何为loadcache指定sql参数,ignite,Ignite,我使用以下sql将数据加载到缓存中 //There are 2 placeholders in the sql String sql = "select * from person where id > ? and id < ?" IgniteCache.loadCache(null, Integer.class.getName(), sql); //sql中有2个占位符 String sql=“从id>和id

我使用以下sql将数据加载到缓存中

//There are 2 placeholders in the sql
String sql = "select * from person where id > ? and id < ?"

IgniteCache.loadCache(null, Integer.class.getName(), sql);
//sql中有2个占位符
String sql=“从id>和id<的人员中选择*”
IgniteCache.loadCache(null,Integer.class.getName(),sql);

如何像
PreparedStatement
那样设置sql的参数?

不幸的是,Ignite不支持loadCache()上的这种格式设置。您可以只传递多个查询:

IgniteCache.loadCache(空,
Integer.class.getName(),sql1,
Integer.class.getName(),sql2,

...);

谢谢@Mitya。如果查询条件是
Date
类型,那就很不方便了,我必须在sql中将日期转换为字符串,然后将用户
转换为\u Date
。@Tom,我认为这是在Ignite中实现的一个好功能。另外,我认为直接向IgniteCache.loadCache()提供PreparedStatement要好得多。如果实际负载基于用户输入,这将非常有用。使用PreparedStatement语句可以防止SQL注入。你们能在ApacheIgniteJira中制造问题吗?谢谢@kuaw26和Valentin