@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 CustomerAddress
public void setId(Long id)
setId
in interface CustomerAddress
public String getAddressName()
getAddressName
in interface CustomerAddress
public void setAddressName(String addressName)
setAddressName
in interface CustomerAddress
public Customer getCustomer()
getCustomer
in interface CustomerAddress
public void setCustomer(Customer customer)
setCustomer
in interface CustomerAddress
public Address getAddress()
getAddress
in interface CustomerAddress
public void setAddress(Address address)
setAddress
in interface CustomerAddress
public Character getArchived()
getArchived
in interface Status
public void setArchived(Character archived)
setArchived
in interface Status
public <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.