Path expected for join!错误处理
来源:互联网 发布:淘宝买东西物流不更新 编辑:程序博客网 时间:2024/06/06 05:34
在hibernate中,进行连接查询时,如果使用join语句,就容易产生标题所示的错误。
比如from Content o left join Mcp mcp where o.mcp.id=mcp.id and mcp.id=2
正确的做法应该是在A中建立private Mcp mcp,并映射,
然后通过from Content o left join o.mcp mcp where mcp.id=2
奇怪吧,这么罗嗦。其实大可不必这样连接操作,只要from Content where mcp is null or mcp.id=2即可
如果在Content对象中建立mcp(对象)字段的话,就用不了join。
这时只能用from Content o,Mcp mcp where o.mcpId is null or (o.mcpId=mcp.id and mcp.id=2)
这时的mcpId是一个与Mcp表中id对应的整型
结论: 尽量不用join,费力不讨好。
0 0
- Path expected for join!错误处理
- Path expected for join!错误处理
- HQL语句 Path expected for join!错误
- HQL join Path expected for join! 原因及处理
- hibernate-Path expected for join问题
- hibernate:Path expected for join问题
- Path expected for join!的解决办法
- 每日一得-org.hibernate.hql.ast.QuerySyntaxException: Path expected for join!错误解决办法
- Hql连接查询的两个错误(Path expected for join!和unexpected token on)
- Hibernate_org.hibernate.hql.ast.QuerySyntaxException: Path expected for join
- jpa或bernate使用原生sql进行关联查询org.hibernate.hql.internal.ast.QuerySyntaxException: Path expected for join
- expected class-name before ‘{’ to 错误处理
- node---path模块,nodeJs的path对象,如何用来处理目录,path.join,path.resolve,path.relative.path
- spring错误处理 Build path is incomplete. Cannot find class file for org.springframework.aop.Advisor
- 黑马程序员--open quote is expected for attribute错误
- Expected BEGIN_OBJECT but was STRING at line 4 column 1 path $ 错误积累
- Join-Path 帮助信息
- Python os.path.join
- 在git@osc上有两个码云账号,如何配置互不干扰?
- LeetCode84 --Largest Rectangle in Histogram
- contentSize、contentOffset、contentInset
- 网络编程中的UDP通信
- loadrunner关联技术的一个示例
- Path expected for join!错误处理
- appstore审核的那些事 --1. 卡死在:正在通过 iTunes Store进行鉴定
- 用dbschema工具导出Informix数据库的结构的具体步骤:
- 结构体/枚举/共用体
- SVN:cleanup failed to process the following paths 错误的解决方案
- 2016年个人总结
- Linux下查看内存的使用情况
- c++ const 全面总结!
- JUnit4中@Before、@After、@Test等注解的作用