@Entity public class CustomerPaymentImpl extends Object implements CustomerPayment
| Modifier and Type | Class and Description |
|---|---|
static class |
CustomerPaymentImpl.Presentation |
| Modifier and Type | Field and Description |
|---|---|
protected Map<String,String> |
additionalFields |
protected Address |
billingAddress |
protected Customer |
customer |
protected Long |
id |
protected boolean |
isDefault |
protected String |
paymentToken |
| Constructor and Description |
|---|
CustomerPaymentImpl() |
| Modifier and Type | Method and Description |
|---|---|
<G extends CustomerPayment> |
createOrRetrieveCopyInstance(MultiTenantCopyContext context)
Clone this entity for the purpose of multiple tenancy.
|
Map<String,String> |
getAdditionalFields() |
Address |
getBillingAddress() |
Customer |
getCustomer() |
Long |
getId() |
String |
getPaymentToken() |
boolean |
isDefault() |
void |
setAdditionalFields(Map<String,String> additionalFields) |
void |
setBillingAddress(Address billingAddress) |
void |
setCustomer(Customer customer) |
void |
setId(Long id) |
void |
setIsDefault(boolean aDefault) |
void |
setPaymentToken(String paymentToken) |
protected Long id
protected Customer customer
protected Address billingAddress
protected String paymentToken
protected boolean isDefault
public void setId(Long id)
setId in interface CustomerPaymentpublic Long getId()
getId in interface CustomerPaymentpublic Customer getCustomer()
getCustomer in interface CustomerPaymentpublic void setCustomer(Customer customer)
setCustomer in interface CustomerPaymentpublic Address getBillingAddress()
getBillingAddress in interface CustomerPaymentpublic void setBillingAddress(Address billingAddress)
setBillingAddress in interface CustomerPaymentpublic String getPaymentToken()
getPaymentToken in interface CustomerPaymentpublic void setPaymentToken(String paymentToken)
setPaymentToken in interface CustomerPaymentpublic boolean isDefault()
isDefault in interface CustomerPaymentpublic void setIsDefault(boolean aDefault)
setIsDefault in interface CustomerPaymentpublic Map<String,String> getAdditionalFields()
getAdditionalFields in interface AdditionalFieldsgetAdditionalFields in interface CustomerPaymentpublic void setAdditionalFields(Map<String,String> additionalFields)
setAdditionalFields in interface AdditionalFieldssetAdditionalFields in interface CustomerPaymentpublic <G extends CustomerPayment> 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<CustomerPayment>context - a context object providing persistence and library functionality for copying entitiesCloneNotSupportedException - if there's a problem detected with the cloning configurationCopyright © 2015. All rights reserved.