@ NoDataFound, есть идеи, пожалуйста?

я есть продукт

@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<ProductEntity> ex = Example.of(product);
Page<ProductEntity> pages = productRepository.findAll(ex, page);

Но я получаю сообщение об ошибке PostgreSQL: PSQLException: ОШИБКА: синтаксическая ошибка в или около "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 )

Добавляет символ «L» для значения Long. Итак, как я могу решить эту проблему?

ОБНОВЛЕНИЕ: Есть ли idies? Все еще не могу решить эту проблему.

ОБНОВЛЕНИЕ: мой репозиторий:

public interface CrudProductRepository extends JpaRepository<ProductEntity, Long>{
}

Пакет JpaRepository:

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

Ответы на вопрос(0)

Ваш ответ на вопрос