Service Layer in Spring Data I'm building a small application in Spring and Spring Data JPA.
I need serval layer. I don't know if I'm doing well.

Here is an example:
POJO

@Entity
public class Product {
    @Id
    @GeneratedValue
    private long Id;
    @NotBlank
    private String name;
    @NotNull
    private int price;

    public long getId() {
        return Id;
    }

    public String getName() {
        return name;
    }

    public int getPrice() {
        return price;
    }

    public void setId(long id) {
        Id = id;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setPrice(int price) {
        this.price = price;
    }

    @Override
    public String toString() {
        return "Product{" +
                "Id=" + Id +
                ", name='" + name + '\'' +
                ", price=" + price +
                '}';
    }
}



REPOSITORY

public interface ProductRepository extends CrudRepository&lt;Product, Long&gt; {
    Product findByName(String name);
    List&lt;Product&gt; getAllProducts();
    Product getProductById(String productId);
    void addProduct(Product product);
}



SERVICE

public interface ProductService  {

    List&lt;Product&gt; getAllProducts();
    Product getProductById(String productId);
    void addProduct(Product product);
}



REPOSITORY IMPLEMENTATION

@Service
public class ProductServiceImpl implements ProductService {
    @Autowired
    private ProductRepository productRepository;

    @Override
    public List&lt;Product&gt; getAllProducts() {
        return productRepository.getAllProducts();
    }

    @Override
    public Product getProductById(String productId) {
        return productRepository.getProductById(productId);
    }

    @Override
    public void addProduct(Product product) {
        productRepository.addProduct(product);

    }

}


It is a good?
Unless How create communication with database in Spring?
Well if I'd review this I'd add the following:


The Id field in Product could be renamed id to follow java convention
Generally it's a good practice to have equals &amp; hashcode methods overridden.


As for the database connection it depends on which Spring &amp; database you are using, does it happen to be Spring Boot?