@Entity public class CandidateItemOfferImpl extends Object implements CandidateItemOffer, Cloneable
Modifier and Type | Field and Description |
---|---|
protected Offer |
deproxiedOffer |
protected Long |
id |
static org.apache.commons.logging.Log |
LOG |
protected Offer |
offer |
protected OrderItem |
orderItem |
static long |
serialVersionUID |
Constructor and Description |
---|
CandidateItemOfferImpl() |
Modifier and Type | Method and Description |
---|---|
void |
checkCloneable(CandidateItemOffer itemOffer) |
CandidateItemOffer |
clone() |
<G extends CandidateItemOffer> |
createOrRetrieveCopyInstance(MultiTenantCopyContext context)
Clone this entity for the purpose of multiple tenancy.
|
boolean |
equals(Object obj) |
Money |
getDiscountedPrice() |
Long |
getId() |
Offer |
getOffer() |
OrderItem |
getOrderItem() |
int |
getPriority() |
int |
hashCode() |
void |
setDiscountedPrice(Money discountedPrice) |
void |
setId(Long id) |
void |
setOffer(Offer offer) |
void |
setOrderItem(OrderItem orderItem) |
public static final org.apache.commons.logging.Log LOG
public static final long serialVersionUID
protected Long id
protected OrderItem orderItem
protected Offer offer
protected Offer deproxiedOffer
public Long getId()
getId
in interface CandidateItemOffer
public void setId(Long id)
setId
in interface CandidateItemOffer
public OrderItem getOrderItem()
getOrderItem
in interface CandidateItemOffer
public void setOrderItem(OrderItem orderItem)
setOrderItem
in interface CandidateItemOffer
public void setOffer(Offer offer)
setOffer
in interface CandidateItemOffer
public int getPriority()
getPriority
in interface CandidateItemOffer
public Offer getOffer()
getOffer
in interface CandidateItemOffer
public Money getDiscountedPrice()
getDiscountedPrice
in interface CandidateItemOffer
public void setDiscountedPrice(Money discountedPrice)
setDiscountedPrice
in interface CandidateItemOffer
public void checkCloneable(CandidateItemOffer itemOffer) throws CloneNotSupportedException, SecurityException, NoSuchMethodException
public CandidateItemOffer clone()
clone
in interface CandidateItemOffer
clone
in class Object
public <G extends CandidateItemOffer> 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<CandidateItemOffer>
context
- a context object providing persistence and library functionality for copying entitiesCloneNotSupportedException
- if there's a problem detected with the cloning configurationCopyright © 2020. All rights reserved.