java - 当我尝试在 Liferay 7.1 中使用 CostumSql 时出现“java.lang.IllegalArgumentException:位置参数不存在”异常
问题描述
我尝试使用 CostumSql,但出现以下异常:
引起:java.lang.IllegalArgumentException:位置参数不存在
这是我的查找器:
Session session = null;
try {
session = openSession();
String sql = _customSQL.get(getClass(),FIND_BY_KEYWORDS);
SQLQuery q = session.createSQLQuery(sql);
q.setCacheable(false);
q.addEntity("BlockchainAccount",BlockchainAccountImpl.class);
QueryPos qPos = QueryPos.getInstance(q);
qPos.add(companyId);
qPos.add(groupId);
qPos.add(keywords);
return (List<BlockchainAccount>) QueryUtil.list(
q, getDialect(), start, end);
}
catch (Exception e) {
try {
throw new SystemException(e);
}
catch (SystemException se) {
se.printStackTrace();
}
}
finally {
closeSession(session);
}
return null;
解决方案
推荐阅读
- cryptography - 在 JavaCard 中设置 ECC 私钥 S 值时出现非法值 CryptoException
- asp.net-core-2.2 - httpdelete请求asp.net core 2中的问题
- javascript - 防止图像幻灯片增长超过容器单元
- gradle - 如何将项目依赖项添加到由 `kotlin-multiplatform` 插件创建的特定平台目标?
- intellij-idea - 使用键盘快捷键在 Intellij 中选择多行
- r - 随着时间的推移总结压缩时间序列的值
- android - Xamarin Android MobileBarcodeScanner.Initialize(Application) not found
- python - python中的Spacy语言模型安装从_mklinit返回ImportError(ImportError:DLL加载失败:找不到指定的模块。)
- html - 如何创建淡出滚动内容但不与滚动条重叠的蒙版?
- javascript - 从 1 月 1 日 00:00 开始,确定当年经过的秒数所需的 JavaScript