@Entity public class PageAttributeImpl extends Object implements PageAttribute, ProfileEntity
Modifier and Type | Field and Description |
---|---|
protected Long |
id |
protected String |
name |
protected Page |
page |
protected String |
value |
Constructor and Description |
---|
PageAttributeImpl() |
Modifier and Type | Method and Description |
---|---|
<G extends PageAttribute> |
createOrRetrieveCopyInstance(MultiTenantCopyContext context)
Clone this entity for the purpose of multiple tenancy.
|
boolean |
equals(Object obj) |
Long |
getId()
Returns the id
|
String |
getName()
The name
|
Page |
getPage()
Returns the
Page |
String |
getValue()
The value
|
int |
hashCode() |
void |
setId(Long id)
Sets the id
|
void |
setName(String name)
The name
|
void |
setPage(Page page)
Sets the
Page |
void |
setValue(String value)
The value
|
String |
toString() |
protected Long id
protected String name
protected String value
protected Page page
public Long getId()
PageAttribute
getId
in interface PageAttribute
public void setId(Long id)
PageAttribute
setId
in interface PageAttribute
public String getValue()
ValueAssignable
getValue
in interface ValueAssignable<String>
public void setValue(String value)
ValueAssignable
setValue
in interface ValueAssignable<String>
value
- The valuepublic String getName()
ValueAssignable
getName
in interface ValueAssignable<String>
public void setName(String name)
ValueAssignable
setName
in interface ValueAssignable<String>
name
- The namepublic Page getPage()
PageAttribute
Page
getPage
in interface PageAttribute
public void setPage(Page page)
PageAttribute
Page
setPage
in interface PageAttribute
public <G extends PageAttribute> 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<PageAttribute>
context
- a context object providing persistence and library functionality for copying entitiesCloneNotSupportedException
- if there's a problem detected with the cloning configurationCopyright © 2022. All rights reserved.