Class CustomerAttributeImpl

java.lang.Object
org.broadleafcommerce.profile.core.domain.CustomerAttributeImpl
All Implemented Interfaces:
Serializable, MultiTenantCloneable<CustomerAttribute>, ValueAssignable<String>, CustomerAttribute

@Entity public class CustomerAttributeImpl extends Object implements CustomerAttribute
See Also:
  • Field Details

    • id

      protected Long id
      The id.
    • name

      protected String name
      The name.
    • value

      protected String value
      The value.
    • customer

      protected Customer customer
      The customer.
  • Constructor Details

    • CustomerAttributeImpl

      public CustomerAttributeImpl()
  • Method Details

    • getId

      public Long getId()
      Description copied from interface: CustomerAttribute
      Gets the id.
      Specified by:
      getId in interface CustomerAttribute
      Returns:
      the id
    • setId

      public void setId(Long id)
      Description copied from interface: CustomerAttribute
      Sets the id.
      Specified by:
      setId in interface CustomerAttribute
      Parameters:
      id - the new id
    • getValue

      public String getValue()
      Description copied from interface: ValueAssignable
      The value
      Specified by:
      getValue in interface ValueAssignable<String>
      Returns:
      The value
    • setValue

      public void setValue(String value)
      Description copied from interface: ValueAssignable
      The value
      Specified by:
      setValue in interface ValueAssignable<String>
      Parameters:
      value - The value
    • getName

      public String getName()
      Description copied from interface: ValueAssignable
      The name
      Specified by:
      getName in interface ValueAssignable<String>
      Returns:
      The name
    • setName

      public void setName(String name)
      Description copied from interface: ValueAssignable
      The name
      Specified by:
      setName in interface ValueAssignable<String>
      Parameters:
      name - The name
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getCustomer

      public Customer getCustomer()
      Description copied from interface: CustomerAttribute
      Gets the associated customer.
      Specified by:
      getCustomer in interface CustomerAttribute
      Returns:
      the customer
    • setCustomer

      public void setCustomer(Customer customer)
      Description copied from interface: CustomerAttribute
      Sets the associated customer.
      Specified by:
      setCustomer in interface CustomerAttribute
    • hashCode

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

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

      public <G extends CustomerAttribute> 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<CustomerAttribute>
      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