@Entity public class MediaImpl extends Object implements Media, MultiTenantCloneable<MediaImpl>
Modifier and Type | Field and Description |
---|---|
protected String |
altText |
protected Long |
id |
protected String |
tags |
protected String |
title |
protected String |
url |
Constructor and Description |
---|
MediaImpl() |
Modifier and Type | Method and Description |
---|---|
<G extends MediaImpl> |
createOrRetrieveCopyInstance(MultiTenantCopyContext context)
Clone this entity for the purpose of multiple tenancy.
|
boolean |
equals(Object obj) |
String |
getAltText() |
Long |
getId() |
String |
getTags() |
String |
getTitle() |
String |
getUrl() |
int |
hashCode() |
boolean |
isUnwrappableAs(Class unwrapType)
Can this wrapped item be unwrapped as the indicated type?
|
void |
setAltText(String altText) |
void |
setId(Long id) |
void |
setTags(String tags) |
void |
setTitle(String title) |
void |
setUrl(String url) |
<T> T |
unwrap(Class<T> unwrapType)
Get the wrapped delegate item
|
protected Long id
protected String url
protected String title
protected String altText
protected String tags
public String getAltText()
getAltText
in interface Media
public void setAltText(String altText)
setAltText
in interface Media
public boolean isUnwrappableAs(Class unwrapType)
Wrappable
isUnwrappableAs
in interface Wrappable
unwrapType
- The type to check.public <T> T unwrap(Class<T> unwrapType)
Wrappable
public <G extends MediaImpl> 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<MediaImpl>
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.