Class PersistentResourceDateReminder
- java.lang.Object
-
- org.silverpeas.core.persistence.datasource.model.jpa.AbstractJpaEntity<E,I>
-
- org.silverpeas.core.persistence.datasource.model.jpa.SilverpeasJpaEntity<PersistentResourceDateReminder,UuidIdentifier>
-
- org.silverpeas.core.datereminder.persistence.PersistentResourceDateReminder
-
- All Implemented Interfaces:
Serializable
,Entity<PersistentResourceDateReminder,UuidIdentifier>
,IdentifiableEntity
@Entity public class PersistentResourceDateReminder extends SilverpeasJpaEntity<PersistentResourceDateReminder,UuidIdentifier>
A persistent date reminder used to identify uniquely a resource. This date reminder has the particularity to be persisted in a data source and to refer the resource it identifies uniquely both by the resource identifier and by the resource type.- Author:
- Cécile Bonin
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static PersistentResourceDateReminder
NONEDATEREMINDER
Represents none dateReminder to replace in more typing way the null keyword.
-
Constructor Summary
Constructors Constructor Description PersistentResourceDateReminder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
boolean
exists()
Indicates if the dateReminder is well registredDateReminderDetail
getDateReminder()
<E,R extends EntityReference<E>>
RgetResource(Class<R> referenceClass)
Gets a reference to the resource this dateReminder is for.String
getResourceType()
Get the resource type if the resource.int
hashCode()
boolean
isDefined()
Return true if resource is definedboolean
notExists()
Indicates if the dateReminder isn't registered.void
setDateReminder(DateReminderDetail dateReminder)
Sets the date, message, processStatus, creatorId and updaterIdvoid
setResource(EntityReference<?> resource)
Sets the resource to which this dateReminder belongs.String
toString()
void
validate()
Validates data-
Methods inherited from class org.silverpeas.core.persistence.datasource.model.jpa.SilverpeasJpaEntity
createdBy, createdBy, createdBy, getCreationDate, getCreator, getCreatorId, getLastUpdateDate, getLastUpdater, getLastUpdaterId, getVersion, hasBeenModified, lastUpdatedBy, markAsModified, performBeforePersist, performBeforeRemove, performBeforeUpdate, setCreationDate, setCreator, setLastUpdateDate, setLastUpdater, setVersion, updatedBy, updatedBy
-
Methods inherited from class org.silverpeas.core.persistence.datasource.model.jpa.AbstractJpaEntity
getId, getNativeId, isPersisted, setId
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.silverpeas.core.persistence.datasource.model.IdentifiableEntity
getId, isPersisted
-
-
-
-
Field Detail
-
NONEDATEREMINDER
public static final PersistentResourceDateReminder NONEDATEREMINDER
Represents none dateReminder to replace in more typing way the null keyword.
-
-
Method Detail
-
exists
public boolean exists()
Indicates if the dateReminder is well registred- Returns:
- a boolean indicating if this dateReminder exists in the data source.
-
notExists
public boolean notExists()
Indicates if the dateReminder isn't registered.- Returns:
- a boolean indicating if this dateReminder doesn't exist in the data source.
-
validate
public void validate() throws DateReminderValidationException
Validates data- Throws:
DateReminderValidationException
-
getResource
public <E,R extends EntityReference<E>> R getResource(Class<R> referenceClass)
Gets a reference to the resource this dateReminder is for.- Type Parameters:
E
- the concrete type of the entity.R
- the concrete type of the reference to the entity.- Parameters:
referenceClass
- the expected concrete class of theEntityReference
. This class must be conform to the type of the resource.- Returns:
- a reference to the resource that owns this dateReminder or null if there is neither no resource defined for this dateReminder nor no reference defined for the targeted type of resource.
-
setResource
public void setResource(EntityReference<?> resource)
Sets the resource to which this dateReminder belongs.- Parameters:
resource
- an identifier of the resource for which this dateReminder is.
-
getResourceType
public String getResourceType()
Get the resource type if the resource.- Returns:
- the resource type
-
getDateReminder
public DateReminderDetail getDateReminder()
- Returns:
- the dateReminder
-
setDateReminder
public void setDateReminder(DateReminderDetail dateReminder)
Sets the date, message, processStatus, creatorId and updaterId- Parameters:
dateReminder
-
-
isDefined
public boolean isDefined()
Return true if resource is defined- Returns:
- boolean
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classSilverpeasJpaEntity<PersistentResourceDateReminder,UuidIdentifier>
-
equals
public boolean equals(Object obj)
- Overrides:
equals
in classSilverpeasJpaEntity<PersistentResourceDateReminder,UuidIdentifier>
-
-