@Entity public class CustomerAddressImpl extends Object implements CustomerAddress
| Modifier and Type | Field and Description |
|---|---|
protected Address |
address |
protected String |
addressName |
protected ArchiveStatus |
archiveStatus |
protected Customer |
customer |
protected Long |
id |
| Constructor and Description |
|---|
CustomerAddressImpl() |
| Modifier and Type | Method and Description |
|---|---|
<G extends CustomerAddress> |
createOrRetrieveCopyInstance(MultiTenantCopyContext context)
Clone this entity for the purpose of multiple tenancy.
|
boolean |
equals(Object obj) |
Address |
getAddress() |
String |
getAddressName() |
Character |
getArchived() |
Customer |
getCustomer() |
Long |
getId() |
int |
hashCode() |
boolean |
isActive() |
void |
setAddress(Address address) |
void |
setAddressName(String addressName) |
void |
setArchived(Character archived) |
void |
setCustomer(Customer customer) |
void |
setId(Long id) |
String |
toString() |
protected Long id
protected String addressName
protected Customer customer
protected Address address
protected ArchiveStatus archiveStatus
public Long getId()
getId in interface CustomerAddresspublic void setId(Long id)
setId in interface CustomerAddresspublic String getAddressName()
getAddressName in interface CustomerAddresspublic void setAddressName(String addressName)
setAddressName in interface CustomerAddresspublic Customer getCustomer()
getCustomer in interface CustomerAddresspublic void setCustomer(Customer customer)
setCustomer in interface CustomerAddresspublic Address getAddress()
getAddress in interface CustomerAddresspublic void setAddress(Address address)
setAddress in interface CustomerAddresspublic Character getArchived()
getArchived in interface Statuspublic void setArchived(Character archived)
setArchived in interface Statuspublic <G extends CustomerAddress> 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<CustomerAddress>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.