content: package com.luv2shopdev.ecommerce.entity;
  
  import lombok.Data;
  import org.hibernate.annotations.CreationTimestamp;
  import org.hibernate.annotations.UpdateTimestamp;
  
  import javax.persistence.*;
  import java.math.BigDecimal;
  import java.util.Date;
  
  @Entity
  @Table(name = "product")
  @Data // lombok - auto-generates getters/setters behind the scenes..
  public class Product {
  
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      @Column(name = "id")
      private Long id;
  
      @ManyToOne
      @JoinColumn(name = "category_id", nullable = false)
      private ProductCategory category;
  
      @Column(name = "sku")
      private String sku;
  
      @Column(name = "name")
      private String name;
  
      @Column(name = "description")
      private String description;
  
      @Column(name = "unit_price")
      private BigDecimal unitPrice;
  
      @Column(name = "image_url")
      private String imageUrl;
  
      @Column(name = "active")
      private boolean isActive;
  
      @Column(name = "units_in_stock")
      private int unitsInStock;
  
      @Column(name = "date_created")
      @CreationTimestamp
      private Date dateCreated;
  
      @Column(name = "last_updated")
      @UpdateTimestamp
      private Date lastUpdated;
  }
  