【发布时间】:2014-03-04 23:01:02
【问题描述】:
public interface EventoRepository extends JpaRepository<Evento, String>, JpaSpecificationExecutor<Evento> {
public Evento findById(String id);
public List<Evento> findByStatus(String status, Pageable page);
public List<Evento> findById_User(Long id_user,Pageable page);
@Query("select count(e) FROM evento e WHERE e.status = ?1 AND e.id_user = ?2")
int countByStatus(String status, long id_user);
@Query("SELECT count(e) FROM evento e WHERE e.id_user= ?1")
int countAll(long id_user);
@Query("SELECT count(e) FROM evento e WHERE e.status IS NOT = ?1 AND e.id_user = ?2")
int countBySospesi(String status, long id_user);
}
我有这种情况,当我在 apache Tomcat 中启动我的项目时,它会生成异常: - 原因:java.lang.IllegalArgumentException:查询方法 public abstract java.lang.Long net.petrikainulainen.spring.social.signinmvc.user.repository.EventoRepository.countAll(long) 的验证失败! - 原因:java.lang.IllegalArgumentException: org.hibernate.hql.internal.ast.QuerySyntaxException: eventto 未映射 [SELECT count(e) FROM eventto e WHERE e.id_user= ?1] - 原因:org.hibernate.hql.internal.ast.QuerySyntaxException:evento 未映射 [SELECT count(e) FROM eventto e WHERE e.id_user= ?1]
谁能帮我找出这个异常的原因吗?
【问题讨论】:
标签: mysql sql spring hibernate jpa