change id to Integer
This commit is contained in:
@ -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; }
|
||||
|
||||
@ -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.
|
||||
}
|
||||
Reference in New Issue
Block a user