我在SQL中有一个查询,用于获取实体对象列表。 我正在获取并将它们存储在类型实体类列表中。我得到一个SQL异常 - 操作操作数的数据类型" ="不兼容.. SQLCODE = -401,SQLSTATE = 42818,DRIVER = 3.62.56
使用SQL编辑器或SQl Explorer在本地和Unix环境中运行查询。
public List<AssessmentApplicationEntity> getActiveAssessmentsForApplication() throws UnableToFetchException
{
List<AssessmentApplicationEntity> list = null;
String sqlQueryStr = "select AAT.ID, AAT.Application_id,AAT.RISK_ASSESSMENT_ID , AAT.ARCHIVE, AAT.USER, AAT.CREATED_DATE, AAT.ASSET_UNIQUE_ID " +
"from assessment_application_table AAT join risk_assessment_table RAT on AAT.RISK_ASSESSMENT_ID = RAT.risk_assess_id "+
" where RAT.status = 'A' and RAT.ISRAENDREP_ISSDT is null and AAT.ARCHIVE IS NULL and RAT.ARCHIVE IS NULL group by AAT.ID, AAT.Application_id, "+
"AAT.RISK_ASSESSMENT_ID , AAT.ARCHIVE, AAT.USER, AAT.CREATED_DATE, AAT.ASSET_UNIQUE_ID ";
Session session = this.getHibernateSession();
SQLQuery sqlQuery = session.createSQLQuery(sqlQueryStr);
sqlQuery.addEntity(AssessmentApplicationEntity.class);
try {
list = sqlQuery.list();