0
这应该相当简单,但我似乎无法找到一个例子。 我想创建一个查询看起来像这样:如何使用EOD SQL创建动态查询?
SELECT column_name FROM table_name WHERE column_name IN (value1,value2,...)
,因为我可以追加或从句的查询结束的选项。
我写的代码至今保持与空指针炸毁:
@Select(sql = "select storename from broadcastrecipient where storecity in (?{1})")
public List<String> getStoresForCities(List<String> theCities) throws SQLException;
在此先感谢。 // Abean
注:我忘了添加一些关于我的环境的信息:PostGres 8.3,Java 1.6和EOD SQL 0.9。
谢谢贾森。 对于那些谁想知道,查询看起来是这样的:
@Select(sql = "select distinct(storename) from broadcastrecipient where storecity = any (?{1})", disconnected=true)
public List<String> getStoresForCities(String[] theCities) throws SQLException;
而且我也需要实施一个TypeMapper映射类SQL-数组Java数组。
您使用的数据库是? – 2009-10-13 14:28:23
对不起,PostGres 8.3。 – ABeanSits 2009-10-13 14:40:38