Class Product
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCalculates the checksum of the product.voidDecrements the stock of the product by the specified amount.Retrieves the interval type associated with the product.getType()Returns the type of the product.intRetrieves the total amount of the product in the warehouse.Retrieves a list of WarehouseProducts associated with this product.voidload()voidsetInterval(IntervalType interval) Sets the interval for the product.voidsetType(ProductType type) Sets the type of the product.
-
Constructor Details
-
Product
public Product()
-
-
Method Details
-
getInterval
Retrieves the interval type associated with the product.- Returns:
- The interval type if set, otherwise null.
-
setInterval
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
Returns the type of the product.- Returns:
- The type of the product, or null if the type is not set.
-
setType
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
Retrieves a list of WarehouseProducts associated with this product.- Returns:
- A list of WarehouseProducts related to the product.
-
decrement
Decrements the stock of the product by the specified amount.- Parameters:
amountIO- The amount to decrement from the stock.
-
calcChecksum
Calculates the checksum of the product.- Returns:
- the checksum of the product as a string
-
load
public void load()
-