springmvc hibernate框架,在执行普通的插入操作时报错,仔细检查实体类文件,确认该属性的getter setter方法都是有的,哭哭(´;︵;`)jpa策略生成的当然有。可是老是报这个错,网上也都是说缺setter方法。还好我仔细,找到一篇终于解决了问题。原因就是在createSQLQuery的时候,如果直接写原生SQL,查询结果无法和实体类联系起来,需要在原生SQL里为每个字段取一个别名,别名为实体类的字段名。无论你的方法是否是通用dao,取别名在SQL里面总是可行的。
相关文章
- 做u盘启动重装系统 进winPE 出现 cdboot:couldn\'t find ntldr 解决办法
- couldn‘t find DSO to load: libjscexecutor.so caused by :dlopen failed:library“libjsc.so“ not found
- Couldn‘t find ffmpeg or avconv - defaulting to ffmpeg, but may not work“, RuntimeWarning
- 真机测试 Thnetwork connection was lost. No profiles for 'xxx' were found: Xcode couldn't find a provisioning profile matching 'xxx'. Code signing is required for product type
- 做u盘启动重装系统 进winPE 出现 cdboot:couldn't find ntldr 解决办法
- 04.ubuntu下kvm 命令行安装64位ubuntu报"Couldn't find hvm kernel for Ubuntu tree."的问题
- android couldn't find so
- bs4 FeatureNotFound: Couldn't find a tree builder with the features you requested: lxml. Do you need to install a parser library?
- Starting MySQL ERROR! Couldn't find MySQL server (/usr/local/mysql/bin/mysqld_safe)
- Win11系统开机弹出:Couldn't find Edge installation怎么办?