change id to Integer

This commit is contained in:
Σlie *
2026-02-27 21:12:37 +01:00
parent e65b02b471
commit abf32e34e4
2 changed files with 4 additions and 4 deletions

View File

@ -8,7 +8,7 @@ public class Product {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private Integer id;
private String name;
@ -19,8 +19,8 @@ public class Product {
private String imageUrl;
// Getters et Setters (indispensables pour Spring)
public Long getId() { return id; }
public void setId(Long id) { this.id = id; }
public Integer getId() { return id; }
public void setId(Integer id) { this.id = id; }
public String getName() { return name; }
public void setName(String name) { this.name = name; }
public String getLink() { return link; }

View File

@ -4,6 +4,6 @@ import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
@Repository
public interface ProductRepository extends JpaRepository<Product, Long> {
public interface ProductRepository extends JpaRepository<Product, Integer> {
// Tu as maintenant accès à : save(), findAll(), deleteById(), etc.
}