java.lang.Object
com.broadleafcommerce.sandbox.provider.jpa.domain.JpaSandbox
All Implemented Interfaces:
com.broadleafcommerce.common.messaging.notification.domain.NotificationStateAware, com.broadleafcommerce.data.tracking.core.mapping.BusinessTypeAware, com.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable, com.broadleafcommerce.data.tracking.core.TenantTrackable<com.broadleafcommerce.data.tracking.jpa.filtering.domain.TenantJpaTracking>, com.broadleafcommerce.data.tracking.core.Trackable, com.broadleafcommerce.data.tracking.core.TypedTrackable<com.broadleafcommerce.data.tracking.jpa.filtering.domain.TenantJpaTracking>, Serializable

@Entity public class JpaSandbox extends Object implements com.broadleafcommerce.data.tracking.core.TenantTrackable<com.broadleafcommerce.data.tracking.jpa.filtering.domain.TenantJpaTracking>, com.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable, com.broadleafcommerce.data.tracking.core.mapping.BusinessTypeAware, Serializable
Repository domain representing a configured sandbox. Sandboxable entities (see TrackableExtension) declare a reference to this Sandbox in Tracking.getSandbox(). Entities created in a sandbox are driven by ContextRequest.getSandboxId(), which is generally set by the admin application. Any Tracking.getSandbox() should map to one of these sandboxes.

This repository domain type specifically maps to the Jpa repository domain.

This entity itself is application discriminated. As a result, ContextRequest during CRUD for this entity is required to have a valid ContextRequest.getApplicationId() value in order to discriminate during reads and keep the application discriminator value (Tracking.getApplication()) up-to-date during updates or creates.

As a Trackable, this entity is also aware of archival state. If archived (Tracking.getArchived()), a Sandbox entity will not be returned by fetch queries.

As a Trackable, this entity is aware of change audit information and will keep track of changes made during creation or updates in the Tracking.getChangeDetails() field. ChangeDetails are not permanent on this entity and will be moved to a permanent audit store on an async interval.

Author:
Jeff Fischer
See Also:
  • Constructor Details

    • JpaSandbox

      public JpaSandbox()
  • Method Details

    • fromMe

      @NonNull public org.modelmapper.ModelMapper fromMe()
      Specified by:
      fromMe in interface com.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable
    • toMe

      @NonNull public org.modelmapper.ModelMapper toMe()
      Specified by:
      toMe in interface com.broadleafcommerce.data.tracking.core.mapping.ModelMapperMappable
    • getBusinessDomainType

      public Class<?> getBusinessDomainType()
      Specified by:
      getBusinessDomainType in interface com.broadleafcommerce.data.tracking.core.mapping.BusinessTypeAware
    • getDisplay

      public Optional<String> getDisplay()
      Specified by:
      getDisplay in interface com.broadleafcommerce.data.tracking.core.Trackable
    • getContextId

      public String getContextId()
      The jpa primary key.
      Specified by:
      getContextId in interface com.broadleafcommerce.data.tracking.core.Trackable
      Returns:
      The jpa primary key
    • getName

      public String getName()
      See Also:
    • getColor

      public String getColor()
      See Also:
    • getDescription

      public String getDescription()
      See Also:
    • getApplication

      public String getApplication()
      See Also:
    • isTemporarySandbox

      public boolean isTemporarySandbox()
    • getTracking

      public com.broadleafcommerce.data.tracking.jpa.filtering.domain.TenantJpaTracking getTracking()
      Retrieve the tracking information from the entity
      Specified by:
      getTracking in interface com.broadleafcommerce.data.tracking.core.Trackable
      Returns:
      Tracking information
    • setContextId

      public void setContextId(String contextId)
      The jpa primary key.
      Specified by:
      setContextId in interface com.broadleafcommerce.data.tracking.core.Trackable
      Parameters:
      _id - The jpa primary key
    • setName

      public void setName(String name)
      See Also:
    • setColor

      public void setColor(String color)
      See Also:
    • setDescription

      public void setDescription(String description)
      See Also:
    • setApplication

      public void setApplication(String application)
      See Also:
    • setTemporarySandbox

      public void setTemporarySandbox(boolean isTemporarySandbox)
    • setTracking

      public void setTracking(com.broadleafcommerce.data.tracking.jpa.filtering.domain.TenantJpaTracking tracking)
      Retrieve the tracking information from the entity
      Specified by:
      setTracking in interface com.broadleafcommerce.data.tracking.core.TypedTrackable<com.broadleafcommerce.data.tracking.jpa.filtering.domain.TenantJpaTracking>
      Parameters:
      tracking - Tracking information
    • toString

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

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

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object