Class ProductStackingRule

java.lang.Object
org.ameba.integration.jpa.BaseEntity
org.ameba.integration.jpa.ApplicationEntity
org.openwms.wms.inventory.ProductStackingRule
All Implemented Interfaces:
Serializable, org.ameba.integration.TypedEntity<Long>

@Entity public class ProductStackingRule extends org.ameba.integration.jpa.ApplicationEntity implements Serializable
A ProductStackingRule is a rule that defines what kind of Product can be stacked on other Products. Additionally a maximum number of units of the stacked Products must be defined.
Author:
Heiko Scherrer
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private Product
    The allowed Product that may be placed on the owning Product (not-null).
    private Product
    Parent Product (not-null).
    private int
    Number of units the allowedProduct can be stacked on the owning baseProduct (not-null).
    (package private) static final String
    To separate fields in toString method.

    Fields inherited from class org.ameba.integration.jpa.ApplicationEntity

    C_ID
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Dear JPA...
    (package private)
    ProductStackingRule(int noProducts, Product baseProduct, Product allowedProduct)
    Create a new ProductStackingRule.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns the allowed Product that may be placed on the owning Product.
    Get the baseProduct.
    int
    Returns the number of Products that may be placed on the owning Product.
    int

    Methods inherited from class org.ameba.integration.jpa.ApplicationEntity

    getPersistentKey, hasPersistentKey, onEntityPersist, onPersist, setPersistentKey

    Methods inherited from class org.ameba.integration.jpa.BaseEntity

    getCreatedBy, getCreateDt, getLastModifiedBy, getLastModifiedDt, getOl, getPk, isNew, setOl

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • SEPARATOR

      static final String SEPARATOR
      To separate fields in toString method.
      See Also:
    • baseProduct

      private Product baseProduct
      Parent Product (not-null).
    • noProducts

      private int noProducts
      Number of units the allowedProduct can be stacked on the owning baseProduct (not-null).
    • allowedProduct

      private Product allowedProduct
      The allowed Product that may be placed on the owning Product (not-null).
  • Constructor Details

    • ProductStackingRule

      protected ProductStackingRule()
      Dear JPA...
    • ProductStackingRule

      ProductStackingRule(int noProducts, Product baseProduct, Product allowedProduct)
      Create a new ProductStackingRule. Define the number of allowedProducts of the allowedProduct type can be stacked on this baseProduct.
      Parameters:
      noProducts - The number of allowedProduct stacks
      baseProduct - The Product that is able to carry all allowedProduct must not be null
      allowedProduct - The Product that can be stacked onto the baseProduct must not be null
  • Method Details

    • getBaseProduct

      public Product getBaseProduct()
      Get the baseProduct.
      Returns:
      The baseProduct.
    • getNoProducts

      public int getNoProducts()
      Returns the number of Products that may be placed on the owning Product.
      Returns:
      The number of allowed Product
    • getAllowedProduct

      public Product getAllowedProduct()
      Returns the allowed Product that may be placed on the owning Product.
      Returns:
      The allowed Product
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class org.ameba.integration.jpa.ApplicationEntity
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class org.ameba.integration.jpa.ApplicationEntity
    • toString

      public String toString()
      Overrides:
      toString in class Object