我要查询2个表..两个表的主键相同 但在数据库中没关联 我写的是
from CustTEntity c left outer join SeleCustTEntity s on c.custId=s.custId where c.comingflag=1
好象这样外连接不行 提示on不对
我直接写成
from CustTEntity c SeleCustTEntity s where c.custId=s.custId and c.comingflag=1
报java.lang.NoSuchMethodError
求解
[b]问题补充:[/b]
还是不行 用select c.*,s.* from CustTEntity c ,com.itm.entity.SaleCustTEntity s where c.custId=s.custId and c.comingflag=1
报的错是 是不是2个实体之间没关联的原因
com.itm.entity.SaleCustTEntity is not mapped [select count(*) from com.itm.entity.CustTEntity c ,com.itm.entity.SaleCustTEntity s where c.custId=s.custId and c.comingflag=1]; nested exception is org.hibernate.hql.ast.QuerySyntaxException: com.itm.entity.SaleCustTEntity is not mapped [select count(*) from com.itm.entity.CustTEntity c ,com.itm.entity.SaleCustTEntity s where c.custId=s.custId and c.comingflag=1]
[b]问题补充:[/b]
用这个查询select c.*,s.* from CustTEntity c left join com.itm.entity.SaleCustTEntity s on c.custId=s.custId where c.comingflag=1
还是NoSuchMethodError
[b]问题补充:[/b]
用sql就麻烦了..调的是别人的工具类
[b]问题补充:[/b]
这个查处来的list的里面是什么?
一个一个的字段?
在往实体里加..
[b]问题补充:[/b]
StatementCallback; bad SQL grammar [select * from (select t.*,rownum as rowno from (select c.*,s.* from a_cust_baseinfo c ,a_cust_coming s where c.custId=s.custId and c.comingflag='1' order by c.contactTel desc ) t)where rowno>='1' and rowno<='10']; nested exception is java.sql.SQLException: ORA-00918: 未明确定义列
看看这个错误
[b]问题补充:[/b]
知道什么原因了..两个表有相同的字段复合查询的时候把他给省略了