Class OfferTargetCriteriaXrefImpl

java.lang.Object
org.broadleafcommerce.core.offer.domain.OfferTargetCriteriaXrefImpl
All Implemented Interfaces:
Serializable, MultiTenantCloneable<OfferTargetCriteriaXref>, QuantityBasedRule, OfferTargetCriteriaXref

@Entity public class OfferTargetCriteriaXrefImpl extends Object implements OfferTargetCriteriaXref, QuantityBasedRule
See Also:
  • Field Details

  • Constructor Details

    • OfferTargetCriteriaXrefImpl

      public OfferTargetCriteriaXrefImpl(Offer offer, OfferItemCriteria offerItemCriteria)
    • OfferTargetCriteriaXrefImpl

      public OfferTargetCriteriaXrefImpl()
  • Method Details

    • getId

      public Long getId()
      Description copied from interface: QuantityBasedRule
      The primary key value for this rule object
      Specified by:
      getId in interface OfferTargetCriteriaXref
      Specified by:
      getId in interface QuantityBasedRule
      Returns:
      the primary key value
    • setId

      public void setId(Long id)
      Description copied from interface: QuantityBasedRule
      The primary key value for this rule object
      Specified by:
      setId in interface OfferTargetCriteriaXref
      Specified by:
      setId in interface QuantityBasedRule
      Parameters:
      id - the primary key value
    • getOffer

      public Offer getOffer()
      Specified by:
      getOffer in interface OfferTargetCriteriaXref
    • setOffer

      public void setOffer(Offer offer)
      Specified by:
      setOffer in interface OfferTargetCriteriaXref
    • getOfferItemCriteria

      public OfferItemCriteria getOfferItemCriteria()
      Specified by:
      getOfferItemCriteria in interface OfferTargetCriteriaXref
    • setOfferItemCriteria

      public void setOfferItemCriteria(OfferItemCriteria offerItemCriteria)
      Specified by:
      setOfferItemCriteria in interface OfferTargetCriteriaXref
    • getQuantity

      public Integer getQuantity()
      Description copied from interface: QuantityBasedRule
      The quantity for which a match must be found using the rule. This generally equates to order item quantity (e.g. 2 shirts matching the rule are required in order to receive a discount)
      Specified by:
      getQuantity in interface QuantityBasedRule
      Returns:
      the quantity of matches required
    • setQuantity

      public void setQuantity(Integer quantity)
      Description copied from interface: QuantityBasedRule
      The quantity for which a match must be found using the rule. This generally equates to order item quantity (e.g. 2 shirts matching the rule are required in order to receive a discount)
      Specified by:
      setQuantity in interface QuantityBasedRule
      Parameters:
      quantity - the quantity of matches required
    • getMatchRule

      public String getMatchRule()
      Description copied from interface: QuantityBasedRule
      The rule in the form of an MVEL expression
      Specified by:
      getMatchRule in interface QuantityBasedRule
      Returns:
      the rule as an MVEL string
    • setMatchRule

      public void setMatchRule(String matchRule)
      Description copied from interface: QuantityBasedRule
      Sets the match rule used to test this item.
      Specified by:
      setMatchRule in interface QuantityBasedRule
      Parameters:
      matchRule - the rule as an MVEL string
    • createEntityInstance

      protected void createEntityInstance()
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • createOrRetrieveCopyInstance

      public <G extends OfferTargetCriteriaXref> CreateResponse<G> createOrRetrieveCopyInstance(MultiTenantCopyContext context) throws CloneNotSupportedException
      Description copied from interface: MultiTenantCloneable
      Clone this entity for the purpose of multiple tenancy. Note, extending classes should follow this pattern:

      public CreateResponse<MyClass> createOrRetrieveCopyInstance(MultiTenantCopyContext context) throws CloneNotSupportedException { CreateResponse<MyClass> createResponse = super.createOrRetrieveCopyInstance(context); if (createResponse.isAlreadyPopulated()) { return createResponse; } MyClass myClone = createResponse.getClone();

      //copy extended field values on myClone here

      return createResponse; }

      Support should also be added for @Embeddable classes that contribute fields (collections or basic) to a cloneable entity:

      public CreateResponse<G extends MyClass> createOrRetrieveCopyInstance(MultiTenantCopyContext context) throws CloneNotSupportedException { CreateResponse createResponse = context.createOrRetrieveCopyInstance(this); MyClass myClone = createResponse.getClone();

      //copy extended field values on myClone here

      return createResponse; }

      Specified by:
      createOrRetrieveCopyInstance in interface MultiTenantCloneable<OfferTargetCriteriaXref>
      Parameters:
      context - a context object providing persistence and library functionality for copying entities
      Returns:
      the resulting copy container, possibly already persisted
      Throws:
      CloneNotSupportedException - if there's a problem detected with the cloning configuration