|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.silverpeas.persistence.model.AbstractEntity<ENTITY,IDENTIFIER_TYPE>
ENTITY
- specify the class name of the entity itself which is handled by a repository
manager.IDENTIFIER_TYPE
- the identifier class name used by ENTITY
for its primary key
definition.public abstract class AbstractEntity<ENTITY extends Entity<ENTITY,IDENTIFIER_TYPE>,IDENTIFIER_TYPE>
This abstract class must be extended by all Silverpeas entity definitions that have to be persisted.
The entity extensions must handleperformBeforePersist()
and performBeforeUpdate()
methods.
Constructor Summary | |
---|---|
AbstractEntity()
|
Method Summary | |
---|---|
ENTITY |
clone()
|
boolean |
equals(Object obj)
|
String |
getComponentInstanceId()
By default, if not implemented by child classes, an exception is thrown. |
UserDetail |
getCreator()
Gets the user which has created the entity (in the persistence environment). |
UserDetail |
getLastUpdater()
Gets the last user which has updated the entity (in the persistence environment). |
boolean |
hasBeenModified()
Indicates if the entity has been modified at least one time. |
int |
hashCode()
|
boolean |
isPersisted()
Indicates if the entity is persisted (commonly if the entity has an id) |
protected void |
performBeforePersist()
This method contains all (technical) informations that must be performed on a entity create. |
protected void |
performBeforeUpdate()
This method contains all (technical) informations that must be performed on a entity update. |
protected abstract ENTITY |
setCreateDate(Date createDate)
|
abstract ENTITY |
setCreatedBy(String createdBy)
|
ENTITY |
setCreator(UserDetail creator)
Sets the user which has created the entity (in the persistence environment). |
protected abstract ENTITY |
setId(String id)
Sets the id of the entity. |
protected abstract ENTITY |
setLastUpdateDate(Date lastUpdateDate)
|
abstract ENTITY |
setLastUpdatedBy(String lastUpdatedBy)
|
ENTITY |
setLastUpdater(UserDetail updater)
Sets the last user which has updated the entity (in the persistence environment). |
protected abstract ENTITY |
setVersion(Long version)
Sets the version of the entity. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.silverpeas.persistence.model.Entity |
---|
getCreateDate, getCreatedBy, getId, getLastUpdateDate, getLastUpdatedBy, getVersion, markAsModified |
Constructor Detail |
---|
public AbstractEntity()
Method Detail |
---|
protected abstract ENTITY setId(String id)
id
- the new id of the entity.
public String getComponentInstanceId()
getComponentInstanceId
in interface Entity<ENTITY extends Entity<ENTITY,IDENTIFIER_TYPE>,IDENTIFIER_TYPE>
protected abstract ENTITY setVersion(Long version)
version
-
protected void performBeforePersist()
protected void performBeforeUpdate()
public abstract ENTITY setCreatedBy(String createdBy)
protected abstract ENTITY setCreateDate(Date createDate)
public abstract ENTITY setLastUpdatedBy(String lastUpdatedBy)
protected abstract ENTITY setLastUpdateDate(Date lastUpdateDate)
public UserDetail getCreator()
Entity
getCreator
in interface Entity<ENTITY extends Entity<ENTITY,IDENTIFIER_TYPE>,IDENTIFIER_TYPE>
public ENTITY setCreator(UserDetail creator)
Entity
setCreator
in interface Entity<ENTITY extends Entity<ENTITY,IDENTIFIER_TYPE>,IDENTIFIER_TYPE>
public UserDetail getLastUpdater()
Entity
getLastUpdater
in interface Entity<ENTITY extends Entity<ENTITY,IDENTIFIER_TYPE>,IDENTIFIER_TYPE>
public ENTITY setLastUpdater(UserDetail updater)
Entity
setLastUpdater
in interface Entity<ENTITY extends Entity<ENTITY,IDENTIFIER_TYPE>,IDENTIFIER_TYPE>
public boolean isPersisted()
Entity
isPersisted
in interface Entity<ENTITY extends Entity<ENTITY,IDENTIFIER_TYPE>,IDENTIFIER_TYPE>
public boolean hasBeenModified()
Entity
hasBeenModified
in interface Entity<ENTITY extends Entity<ENTITY,IDENTIFIER_TYPE>,IDENTIFIER_TYPE>
public final int hashCode()
hashCode
in class Object
public final boolean equals(Object obj)
equals
in class Object
public ENTITY clone()
clone
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |