错误找不到类型 com.gridsearch.entities.Film 的属性
我的存储库
package com.gridsearch.repository;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.repository.CrudRepository;
import com.gridsearch.entities.Film;
public interface FilmRepository extends CrudRepository<Film,Short>{
public Page<Film> findAll(Pageable page);
public Film findOne(short Id);
}
我的服务
package com.gridsearch.service;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import com.gridsearch.entities.Film;
public interface FilmService {
public Page<Film> allFilms(Pageable page);
public Film findOne(int Id);
}
我的服务实现
package com.gridsearch.service;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
import com.gridsearch.entities.Film;
import com.gridsearch.repository.FilmRepository;
@Repository
public class FilmServiceImpl implements FilmService{
@Autowired
private FilmRepository repository;
@Transactional
public Page<Film> allFilms(Pageable page) {
return repository.findAll(page);
}
@Override
public Film findOne(int id) {
return repository.findOne((short) id);
}
}