Class StructuredContentRuleImpl
java.lang.Object
org.broadleafcommerce.cms.structure.domain.StructuredContentRuleImpl
- All Implemented Interfaces:
Serializable,StructuredContentRule,MultiTenantCloneable<StructuredContentRule>,ProfileEntity,SimpleRule
@Entity
public class StructuredContentRuleImpl
extends Object
implements StructuredContentRule, ProfileEntity
- Author:
- jfischer
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionBuilds a copy of this content rule.<G extends StructuredContentRule>
CreateResponse<G>Clone this entity for the purpose of multiple tenancy.booleangetId()Gets the primary key.The rule in the form of an MVEL expressioninthashCode()voidSets the primary key.voidsetMatchRule(String matchRule) Sets the match rule used to test this item.
-
Field Details
-
id
-
matchRule
-
-
Constructor Details
-
StructuredContentRuleImpl
public StructuredContentRuleImpl()
-
-
Method Details
-
getId
Description copied from interface:StructuredContentRuleGets the primary key.- Specified by:
getIdin interfaceStructuredContentRule- Returns:
- the primary key
-
setId
Description copied from interface:StructuredContentRuleSets the primary key.- Specified by:
setIdin interfaceStructuredContentRule- Parameters:
id- the new primary key
-
getMatchRule
Description copied from interface:SimpleRuleThe rule in the form of an MVEL expression- Specified by:
getMatchRulein interfaceSimpleRule- Returns:
- the rule as an MVEL string
-
setMatchRule
Description copied from interface:SimpleRuleSets the match rule used to test this item.- Specified by:
setMatchRulein interfaceSimpleRule- Parameters:
matchRule- the rule as an MVEL string
-
hashCode
public int hashCode() -
equals
-
cloneEntity
Description copied from interface:StructuredContentRuleBuilds a copy of this content rule. Used by the content management system when an item is edited.- Specified by:
cloneEntityin interfaceStructuredContentRule- Returns:
- a copy of this rule
-
createOrRetrieveCopyInstance
public <G extends StructuredContentRule> CreateResponse<G> createOrRetrieveCopyInstance(MultiTenantCopyContext context) throws CloneNotSupportedException Description copied from interface:MultiTenantCloneableClone 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();Support should also be added for @Embeddable classes that contribute fields (collections or basic) to a cloneable entity://copy extended field values on myClone here
return createResponse; }
public CreateResponse<G extends MyClass> createOrRetrieveCopyInstance(MultiTenantCopyContext context) throws CloneNotSupportedException { CreateResponsecreateResponse = context.createOrRetrieveCopyInstance(this); MyClass myClone = createResponse.getClone(); //copy extended field values on myClone here
return createResponse; }
- Specified by:
createOrRetrieveCopyInstancein interfaceMultiTenantCloneable<StructuredContentRule>- 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
-