Package com.atlassian.confluence.core
Class AbstractVersionedEntityObject
java.lang.Object
com.atlassian.core.bean.EntityObject
com.atlassian.confluence.core.AnnotatedEntityObject
com.atlassian.confluence.core.ConfluenceEntityObject
com.atlassian.confluence.core.AbstractVersionedEntityObject
- All Implemented Interfaces:
Versioned,Serializable,Cloneable
- Direct Known Subclasses:
AbstractLabelableEntityObject
public abstract class AbstractVersionedEntityObject
extends ConfluenceEntityObject
implements Versioned, Cloneable
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidRemove all data from the object that does not need to be saved by historical versions.protected StringGet the latest, current version of this versioned object.intReturn the version number of this version of the object.getVersionChildPolicy(ContentType contentType) Returns the rightVersionChildOwnerPolicydepending on the passed contentType.booleanbooleanisNew()Is this the first version of this object?voidsetOriginalVersion(Versioned originalVersion) Set the current version of this object.voidsetVersion(int version) Set the version number of this version of the object.Methods inherited from class com.atlassian.confluence.core.ConfluenceEntityObject
getCreator, getCreatorName, getLastModifier, getLastModifierName, getRealClass, isPersistent, setCreator, setCreatorName, setLastModifier, setLastModifierNameMethods inherited from class com.atlassian.confluence.core.AnnotatedEntityObject
getCreationDate, getLastModificationDateMethods inherited from class com.atlassian.core.bean.EntityObject
clone, equals, getCurrentDate, getId, hashCode, setClock, setCreationDate, setId, setLastModificationDateMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.atlassian.confluence.core.Versioned
applyChildVersioningPolicy
-
Field Details
-
INITIAL_VERSION
protected static final int INITIAL_VERSION- See Also:
-
-
Constructor Details
-
AbstractVersionedEntityObject
public AbstractVersionedEntityObject()
-
-
Method Details
-
getVersion
public int getVersion()Description copied from interface:VersionedReturn the version number of this version of the object. Version numbers are integers in ascending chronological order from 1 (the first version). Clients must not assume if two versions x and y exist, that any integer versions between x and y also exist.- Specified by:
getVersionin interfaceVersioned- Returns:
- the version number of this version of the object
-
setVersion
public void setVersion(int version) Description copied from interface:VersionedSet the version number of this version of the object. Only call this method if you are creating a new version.- Specified by:
setVersionin interfaceVersioned- Parameters:
version- the new version number for this version of the object.
-
isNew
public boolean isNew()Description copied from interface:VersionedIs this the first version of this object? -
setOriginalVersion
Description copied from interface:VersionedSet the current version of this object. After this method is called, this object will become an historical version of the object passed in.- Specified by:
setOriginalVersionin interfaceVersioned- Parameters:
originalVersion- the current version of this object.
-
getLatestVersion
Description copied from interface:VersionedGet the latest, current version of this versioned object. If this object is the current version, return this object.Note that drafts are a special version of a
ContentEntityObjectso for drafts this method should return theContentEntityObjectthe drafts points to if it exists and the draft itself otherwise.- Specified by:
getLatestVersionin interfaceVersioned- Returns:
- the current version of this object.
- See Also:
-
convertToHistoricalVersion
public void convertToHistoricalVersion()Description copied from interface:VersionedRemove all data from the object that does not need to be saved by historical versions. For versioned objects that are persisted, this includes removing associations with other persisted objects that may otherwise cause us to break the expected arity of the database relations.When 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.
- Specified by:
convertToHistoricalVersionin interfaceVersioned
-
isLatestVersion
public boolean isLatestVersion()- Specified by:
isLatestVersionin interfaceVersioned- Returns:
- true if this is the latest (current) version of the object, false if it is an historical version.
-
getVersionChildPolicy
Description copied from interface:VersionedReturns the rightVersionChildOwnerPolicydepending on the passed contentType. By default,VersionChildOwnerPolicy.currentVersionis returnedRight now, this is only enforced for children with content type Attachment or Comment
- Specified by:
getVersionChildPolicyin interfaceVersioned
-
getConfluenceRevision
-