Class SystemPropertyImpl

java.lang.Object
org.broadleafcommerce.common.config.domain.SystemPropertyImpl
All Implemented Interfaces:
Serializable, AdminMainEntity, SystemProperty, SystemPropertyAdminPresentation, MultiTenantCloneable<SystemProperty>

@Entity public class SystemPropertyImpl extends Object implements SystemProperty, AdminMainEntity, SystemPropertyAdminPresentation
Allows the storage and retrieval of System Properties in the database

User: Kelly Tisdell Date: 6/20/12

See Also:
  • Field Details

    • id

      protected Long id
    • name

      protected String name
    • overrideGeneratedPropertyName

      protected Boolean overrideGeneratedPropertyName
    • value

      protected String value
    • propertyType

      protected String propertyType
    • friendlyName

      protected String friendlyName
    • friendlyGroup

      protected String friendlyGroup
    • friendlyTab

      protected String friendlyTab
  • Constructor Details

    • SystemPropertyImpl

      public SystemPropertyImpl()
  • Method Details

    • getId

      public Long getId()
      Description copied from interface: SystemProperty
      Unique id of the DB record
      Specified by:
      getId in interface SystemProperty
      Returns:
    • setId

      public void setId(Long id)
      Description copied from interface: SystemProperty
      Sets the id of the DB record
      Specified by:
      setId in interface SystemProperty
    • getName

      public String getName()
      Description copied from interface: SystemProperty
      The name of the property as it exists in property files (for example googleAnalytics.webPropertyId)
      Specified by:
      getName in interface SystemProperty
      Returns:
    • setName

      public void setName(String name)
      Description copied from interface: SystemProperty
      Sets the property name.
      Specified by:
      setName in interface SystemProperty
    • getOverrideGeneratedPropertyName

      public Boolean getOverrideGeneratedPropertyName()
      Description copied from interface: SystemProperty
      Declares whether or not the property name has been overridden, rather than using the default generated value.
      Specified by:
      getOverrideGeneratedPropertyName in interface SystemProperty
      Returns:
    • setOverrideGeneratedPropertyName

      public void setOverrideGeneratedPropertyName(Boolean overrideGeneratedPropertyName)
      Description copied from interface: SystemProperty
      Sets the overrideGeneratedPropertyName.
      Specified by:
      setOverrideGeneratedPropertyName in interface SystemProperty
    • getValue

      public String getValue()
      Description copied from interface: SystemProperty
      Returns the property value.
      Specified by:
      getValue in interface SystemProperty
    • setValue

      public void setValue(String value)
      Description copied from interface: SystemProperty
      Sets the property value.
      Specified by:
      setValue in interface SystemProperty
    • getFriendlyName

      public String getFriendlyName()
      Specified by:
      getFriendlyName in interface SystemProperty
      Returns:
      the friendly name of this property
    • setFriendlyName

      public void setFriendlyName(String friendlyName)
      Description copied from interface: SystemProperty
      Sets the friendly name of this property
      Specified by:
      setFriendlyName in interface SystemProperty
    • getFriendlyGroup

      public String getFriendlyGroup()
      Specified by:
      getFriendlyGroup in interface SystemProperty
      Returns:
      the griendly group name of this property
    • setFriendlyGroup

      public void setFriendlyGroup(String friendlyGroup)
      Description copied from interface: SystemProperty
      Sets the friendly group name of this property
      Specified by:
      setFriendlyGroup in interface SystemProperty
    • getFriendlyTab

      public String getFriendlyTab()
      Specified by:
      getFriendlyTab in interface SystemProperty
      Returns:
      the friendly tab of this property
    • setFriendlyTab

      public void setFriendlyTab(String friendlyTab)
      Description copied from interface: SystemProperty
      Sets the friendly tab of this property
      Specified by:
      setFriendlyTab in interface SystemProperty
    • getPropertyType

      public SystemPropertyFieldType getPropertyType()
      Description copied from interface: SystemProperty
      Returns the property field type. If not set, returns STRING
      Specified by:
      getPropertyType in interface SystemProperty
      Returns:
    • setPropertyType

      public void setPropertyType(SystemPropertyFieldType propertyType)
      Description copied from interface: SystemProperty
      Sets the property field type.
      Specified by:
      setPropertyType in interface SystemProperty
    • getMainEntityName

      public String getMainEntityName()
      Specified by:
      getMainEntityName in interface AdminMainEntity
      Returns:
      the display name of this entity for the admin screen
    • createOrRetrieveCopyInstance

      public <G extends SystemProperty> 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<SystemProperty>
      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
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object