java.lang.Object
de.bytestore.hostinger.entity.ecommerce.Product

@Entity(name="host_Products") @Configurable(preConstruction=true) public class Product extends Object
Represents a product entity with various attributes such as name, price, manufacturer, category, and additional information like tax, description, and inventory details. The Product class provides methods to access and manipulate these attributes, including relationships with associated entities like categories and manufacturers. It also includes features for retrieving stock data and managing product interval and type.
  • Constructor Details

    • Product

      public Product()
  • Method Details

    • getInterval

      public IntervalType getInterval()
      Retrieves the interval type associated with the product.
      Returns:
      The interval type if set, otherwise null.
    • setInterval

      public void setInterval(IntervalType interval)
      Sets the interval for the product.
      Parameters:
      interval - The interval for the product. If the provided interval is null, the interval ID will be set to null. Otherwise, the interval ID will be set to the ID of the provided interval type.
    • getType

      public ProductType getType()
      Returns the type of the product.
      Returns:
      The type of the product, or null if the type is not set.
    • setType

      public void setType(ProductType type)
      Sets the type of the product.
      Parameters:
      type - The type of the product. If the provided type is null, the type ID will be set to null. Otherwise, the type ID will be set to the ID of the provided product type.
    • getWarehouseAmount

      public int getWarehouseAmount()
      Retrieves the total amount of the product in the warehouse.
      Returns:
      The total amount of the product in the warehouse.
    • getWarehouses

      public List<WarehouseProduct> getWarehouses()
      Retrieves a list of WarehouseProducts associated with this product.
      Returns:
      A list of WarehouseProducts related to the product.
    • decrement

      public void decrement(Integer amountIO)
      Decrements the stock of the product by the specified amount.
      Parameters:
      amountIO - The amount to decrement from the stock.
    • calcChecksum

      public String calcChecksum()
      Calculates the checksum of the product.
      Returns:
      the checksum of the product as a string
    • load

      public void load()