public abstract class AbstractVersionedEntityObject extends ConfluenceEntityObject implements Versioned, Cloneable
| Modifier and Type | Field and Description |
|---|---|
protected static int |
INITIAL_VERSION |
| Constructor and Description |
|---|
AbstractVersionedEntityObject() |
| Modifier and Type | Method and Description |
|---|---|
void |
applyChildVersioningPolicy(Versioned versionToPromote,
ObjectDao dao)
If
Versioned.getVersionChildPolicy(com.atlassian.confluence.api.model.content.ContentType) specifies so, moves content from versionToPromote to this Versioned instance or
makes no change. |
void |
convertToHistoricalVersion()
Remove all data from the object that does not need to be saved by historical versions.
|
Versioned |
getLatestVersion()
Get the latest, current version of this versioned object.
|
ConfluenceEntityObject |
getOriginalVersion()
Deprecated.
since 2.5. Use
getLatestVersion() and isLatestVersion() instead. |
int |
getVersion()
Return the version number of this version of the object.
|
VersionChildOwnerPolicy |
getVersionChildPolicy(ContentType contentType)
Returns the right
VersionChildOwnerPolicy depending on the passed contentType. |
boolean |
isLatestVersion()
Is this the latest version of the object? If this method returns true, then
Versioned.getOriginalVersion() will return null. |
boolean |
isNew()
Is this the first version of this object?
|
void |
setOriginalVersion(Versioned originalVersion)
Set the current version of this object.
|
void |
setVersion(int version)
Set the version number of this version of the object.
|
getCreator, getCreatorName, getLastModifier, getLastModifierName, getRealClass, isPersistent, setCreator, setCreatorName, setLastModifier, setLastModifierNameprotected static final int INITIAL_VERSION
public int getVersion()
VersionedgetVersion in interface Versionedpublic void setVersion(int version)
VersionedsetVersion in interface Versionedversion - the new version number for this version of the object.public boolean isNew()
Versionedpublic ConfluenceEntityObject getOriginalVersion()
getLatestVersion() and isLatestVersion() instead.getOriginalVersion in interface Versionedpublic void setOriginalVersion(Versioned originalVersion)
VersionedsetOriginalVersion in interface VersionedoriginalVersion - the current version of this object.public Versioned getLatestVersion()
VersionedgetLatestVersion in interface Versionedpublic void convertToHistoricalVersion()
VersionedWhen using Hibernate to persist versioned objects, take special care to null any field that might contain a Hibernate-persisted collection, as Hibernate does not allow two different persistent objects to refer to the same persisted collection at the same time.
convertToHistoricalVersion in interface Versionedpublic void applyChildVersioningPolicy(Versioned versionToPromote, ObjectDao dao)
VersionedVersioned.getVersionChildPolicy(com.atlassian.confluence.api.model.content.ContentType) specifies so, moves content from versionToPromote to this Versioned instance or
makes no change.applyChildVersioningPolicy in interface VersionedversionToPromote - the new version of the current instance that we're getting the children fromdao - dao used to delete dangling contained contentpublic boolean isLatestVersion()
VersionedVersioned.getOriginalVersion() will return null.isLatestVersion in interface Versionedpublic VersionChildOwnerPolicy getVersionChildPolicy(ContentType contentType)
VersionedVersionChildOwnerPolicy depending on the passed contentType.
By default, VersionChildOwnerPolicy.currentVersion is returned
Right now, this is only enforced for children with content type Attachment or CommentgetVersionChildPolicy in interface VersionedCopyright © 2003–2015 Atlassian. All rights reserved.