我是HQL的新手,我需要此错误的帮助。
查询:
String hqlsearchSelect =
"select new com.eteligent.core.loans.paging.LoansAppCustomerPageItem("
+ "main.loanno, (SELECT acct.id.clientid FROM LMSAccountInfo acct WHERE acct.loanno = main.loanno), (SELECT acct.name FROM LMSAccountInfo acct WHERE acct.loanno = main.loanno), main.acctsts, "
+ "main.loanbal, (SELECT acct.matdt FROM LMSAccountInfo acct WHERE acct.loanno = main.loanno) )";
我认为查询无法确定要返回的记录。
构造函数(LoansAppCustomerPageItem):
public LoansAppCustomerPageItem( final String acctNo, final String cifNo, final String customerName, final Integer acctStat, final BigDecimal acctBal, final Date acctDueDate )
{
super();
this.acctNo = acctNo;
this.cifNo = cifNo;
this.customerName = customerName;
this.acctStat = acctStat;
this.acctBal = acctBal;
this.acctDueDate = acctDueDate;
}
最佳答案
如果您想从子查询中仅获取一行,请在子查询末尾使用LIMIT 1
。