You*_*sef 5 hibernate jpa spring-data
当我尝试这个查询
public interface AppelOffreRespository extends JpaRepository<AppelOffre, Integer>, QueryDslPredicateExecutor<AppelOffre> {
@Query("select new AOCalendarModel( ao.xx, ao.yy, ao.zz) from AO ao ...
Set<AOCalendarModel> findAoForCalForFav(..)
...
}
Run Code Online (Sandbox Code Playgroud)
我收到了这个错误
org.hibernate.hql.internal.ast.QuerySyntaxException: Unable to locate class [AOCalendarModel] [select new AOCalendarMode ....
Run Code Online (Sandbox Code Playgroud)
我的模特
public class AOCalendarModel {
public Integer xx;
public String yy;
public Date zz;
...
}
Run Code Online (Sandbox Code Playgroud)
我们找到的解决方案,我们刚才添加的完整路径AOCalendarModel是formbean.AOCalendarModel
@Query("select new formbean.AOCalendarModel( ao.xx, ao.yy, ao.zz) from AO ao ...
Set<AOCalendarModel> findAoForCalForFav(..)
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5251 次 |
| 最近记录: |