无法在选择查询中的新对象后找到类

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)

You*_*sef 9

我们找到的解决方案,我们刚才添加的完整路径AOCalendarModelformbean.AOCalendarModel

 @Query("select new formbean.AOCalendarModel( ao.xx, ao.yy, ao.zz) from AO ao ...
 Set<AOCalendarModel> findAoForCalForFav(..)
Run Code Online (Sandbox Code Playgroud)