@Entity public class OfferCodeImpl extends Object implements OfferCode
Modifier and Type | Field and Description |
---|---|
protected ArchiveStatus |
archiveStatus |
protected Offer |
deproxiedOffer |
protected String |
emailAddress |
protected Long |
id |
protected Integer |
maxUses |
protected Offer |
offer |
protected String |
offerCode |
protected Date |
offerCodeEndDate |
protected Date |
offerCodeStartDate |
protected List<Order> |
orders |
protected Offer |
sbClonedOffer |
static long |
serialVersionUID |
protected int |
uses
Deprecated.
|
Constructor and Description |
---|
OfferCodeImpl() |
Modifier and Type | Method and Description |
---|---|
<G extends OfferCode> |
createOrRetrieveCopyInstance(MultiTenantCopyContext context)
Clone this entity for the purpose of multiple tenancy.
|
boolean |
equals(Object o) |
Character |
getArchived() |
String |
getEmailAddress() |
Date |
getEndDate() |
Long |
getId() |
int |
getMaxUses()
Returns the maximum number of times that this code can be used regardless of Order or Customer
0 indicates unlimited usage.
|
Offer |
getOffer() |
String |
getOfferCode() |
List<Order> |
getOrders() |
Date |
getStartDate() |
int |
getUses()
Deprecated.
|
int |
hashCode() |
boolean |
isActive() |
boolean |
isLimitedUse()
Indicates that this code has a limit on how many times it can be used.
|
boolean |
isUnlimitedUse()
Indicates that this is an unlimited-use code.
|
void |
setArchived(Character archived) |
void |
setEmailAddress(String emailAddress) |
void |
setEndDate(Date endDate) |
void |
setId(Long id) |
void |
setMaxUses(int maxUses)
Sets the maximum number of times that this code can be used regardless of Order or Customer
0 indicates unlimited usage.
|
void |
setOffer(Offer offer) |
void |
setOfferCode(String offerCode) |
void |
setOrders(List<Order> orders) |
void |
setStartDate(Date startDate) |
void |
setUses(int uses)
Deprecated.
|
public static final long serialVersionUID
protected Long id
protected Offer offer
protected String offerCode
protected Date offerCodeStartDate
protected Date offerCodeEndDate
protected Integer maxUses
@Deprecated protected int uses
protected String emailAddress
protected ArchiveStatus archiveStatus
protected Offer sbClonedOffer
protected Offer deproxiedOffer
public String getOfferCode()
getOfferCode
in interface OfferCode
public void setOfferCode(String offerCode)
setOfferCode
in interface OfferCode
public int getMaxUses()
OfferCode
getMaxUses
in interface OfferCode
public void setMaxUses(int maxUses)
OfferCode
setMaxUses
in interface OfferCode
public boolean isUnlimitedUse()
OfferCode
OfferCode.getMaxUses()
== 0isUnlimitedUse
in interface OfferCode
public boolean isLimitedUse()
OfferCode
OfferCode.getMaxUses()
> 0isLimitedUse
in interface OfferCode
@Deprecated public int getUses()
@Deprecated public void setUses(int uses)
public String getEmailAddress()
getEmailAddress
in interface OfferCode
public void setEmailAddress(String emailAddress)
setEmailAddress
in interface OfferCode
public Date getStartDate()
getStartDate
in interface OfferCode
public void setStartDate(Date startDate)
setStartDate
in interface OfferCode
public Date getEndDate()
getEndDate
in interface OfferCode
public void setEndDate(Date endDate)
setEndDate
in interface OfferCode
public Character getArchived()
getArchived
in interface Status
public void setArchived(Character archived)
setArchived
in interface Status
public <G extends OfferCode> 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<OfferCode>
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.