|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.core.bean.EntityObject com.atlassian.confluence.core.ConfluenceEntityObject com.atlassian.confluence.core.AbstractVersionedEntityObject
public abstract class AbstractVersionedEntityObject
Field Summary | |
---|---|
protected static int |
INITIAL_VERSION
|
Constructor Summary | |
---|---|
AbstractVersionedEntityObject()
|
Method Summary | |
---|---|
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. |
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. |
Methods inherited from class com.atlassian.confluence.core.ConfluenceEntityObject |
---|
getCreator, getCreatorName, getLastModifier, getLastModifierName, getRealClass, isPersistent, setCreator, setCreatorName, setLastModifier, setLastModifierName |
Methods inherited from class com.atlassian.core.bean.EntityObject |
---|
clone, equals, getCreationDate, getCurrentDate, getId, getLastModificationDate, hashCode, setClock, setCreationDate, setId, setLastModificationDate |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final int INITIAL_VERSION
Constructor Detail |
---|
public AbstractVersionedEntityObject()
Method Detail |
---|
public int getVersion()
Versioned
getVersion
in interface Versioned
public void setVersion(int version)
Versioned
setVersion
in interface Versioned
version
- the new version number for this version of the object.public boolean isNew()
Versioned
isNew
in interface Versioned
public ConfluenceEntityObject getOriginalVersion()
getLatestVersion()
and isLatestVersion()
instead.
getOriginalVersion
in interface Versioned
public void setOriginalVersion(Versioned originalVersion)
Versioned
setOriginalVersion
in interface Versioned
originalVersion
- the current version of this object.public Versioned getLatestVersion()
Versioned
getLatestVersion
in interface Versioned
public void convertToHistoricalVersion()
Versioned
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.
convertToHistoricalVersion
in interface Versioned
public boolean isLatestVersion()
Versioned
Versioned.getOriginalVersion()
will return null.
isLatestVersion
in interface Versioned
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |