No Need to Override. What i have done is i have created a repository i.e
FavoriteRepository which is extending JpaRepository and i have mentioned the
dbmodel name (Favorite)
like this JpaRepository<Favorite, Long> // Here Favorite is my model name
and Long is the type of primary key mentioned in db model Favorite as @Id
@Repository
public interface FavoriteRepository extends JpaRepository<Favorite, Long>{
}
Now you can use method findOne or findAll. As these methods are present in
Jparepository.Hope so it will help
If you want to add new method then use @Query with JpQL
@Query(value = "select f from Favorite f where f.userId=:userId ")
public List<Favorite> getFavoritesForUser(@Param("userId") String userId);
打開EclipseLink日誌記錄並顯示您的實體。它可能是一個複雜的對象圖,其中熱切希望獲取的關係迫使提供者在對象模型中引入所有引用的實體。 – Chris