数据JPA。 按示例查询。 无法使用Long值进行搜索

我有一个实体产品

@Entity @Table(name = "Products") public class ProductEntity implements Serializable{ @Id @GenericGenerator(name = "generator", strategy = "increment") @GeneratedValue(strategy=GenerationType.AUTO) private Long id; @Column(name = "model", nullable = false) private String model; //setters and getters } 

在这里我是如何尝试通过示例查询:

 ProductEntity product = new ProductEntity(); product.setId(productId); Example ex = Example.of(product); Page pages = productRepository.findAll(ex, page); 

但我得到PostgreSQL错误:PSQLException:错误:语法错误在“L”或接近“L”。

这是创建的查询:

 Hibernate: select productent0_.id as id1_13_, productent0_.brand_id as brand_id9_13_, productent0_.imgPath as imgPath2_13_, productent0_.model as model3_13_, productent0_.numberOfEvaluation as numberOf4_13_, productent0_.priceBuy as priceBuy5_13_, productent0_.priceSell as priceSel6_13_, productent0_.rating as rating7_13_, productent0_.sumOfEvaluation as sumOfEva8_13_, productent0_.type_id as type_id10_13_ from Products productent0_ where (productent0_.id=1L ) limit ? 

systax错误在这里:

 where (productent0_.id=1L ) 

它为Long值添加了’L’字符。 那么,我该如何解决这个问题呢?

更新:任何idies? 仍然无法解决这个问题。

更新:我的存储库:

 public interface CrudProductRepository extends JpaRepository{ } 

JpaRepository的包:

 import org.springframework.data.jpa.repository.JpaRepository;