@Entity public class OfferOfferRuleXrefImpl extends Object implements OfferOfferRuleXref, SimpleRule
Modifier and Type | Field and Description |
---|---|
protected Long |
id |
protected String |
key |
protected Offer |
offer |
protected OfferRule |
offerRule |
Constructor and Description |
---|
OfferOfferRuleXrefImpl() |
OfferOfferRuleXrefImpl(Offer offer,
OfferRule offerRule,
String key) |
Modifier and Type | Method and Description |
---|---|
protected void |
createEntityInstance() |
<G extends OfferOfferRuleXref> |
createOrRetrieveCopyInstance(MultiTenantCopyContext context)
Clone this entity for the purpose of multiple tenancy.
|
Long |
getId() |
String |
getKey() |
String |
getMatchRule()
The rule in the form of an MVEL expression
|
Offer |
getOffer() |
OfferRule |
getOfferRule() |
void |
setId(Long id) |
void |
setKey(String key) |
void |
setMatchRule(String matchRule)
Sets the match rule used to test this item.
|
void |
setOffer(Offer offer) |
void |
setOfferRule(OfferRule offerRule) |
protected Long id
protected Offer offer
protected OfferRule offerRule
protected String key
public Long getId()
getId
in interface OfferOfferRuleXref
public void setId(Long id)
setId
in interface OfferOfferRuleXref
public Offer getOffer()
getOffer
in interface OfferOfferRuleXref
public void setOffer(Offer offer)
setOffer
in interface OfferOfferRuleXref
public OfferRule getOfferRule()
getOfferRule
in interface OfferOfferRuleXref
public void setOfferRule(OfferRule offerRule)
setOfferRule
in interface OfferOfferRuleXref
public String getKey()
getKey
in interface OfferOfferRuleXref
public void setKey(String key)
setKey
in interface OfferOfferRuleXref
public String getMatchRule()
SimpleRule
getMatchRule
in interface SimpleRule
public void setMatchRule(@Nonnull String matchRule)
SimpleRule
setMatchRule
in interface SimpleRule
matchRule
- the rule as an MVEL stringprotected void createEntityInstance()
public <G extends OfferOfferRuleXref> CreateResponse<G> createOrRetrieveCopyInstance(MultiTenantCopyContext context) throws CloneNotSupportedException
MultiTenantCloneable
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;
}
createOrRetrieveCopyInstance
in interface MultiTenantCloneable<OfferOfferRuleXref>
context
- a context object providing persistence and library functionality for copying entitiesCloneNotSupportedException
- if there's a problem detected with the cloning configurationCopyright © 2019. All rights reserved.