org.silverpeas.dateReminder.persistent
Class PersistentResourceDateReminder

java.lang.Object
  extended by org.silverpeas.persistence.model.AbstractEntity<ENTITY,IDENTIFIER_TYPE>
      extended by org.silverpeas.persistence.model.jpa.AbstractJpaEntity<PersistentResourceDateReminder,UuidIdentifier>
          extended by org.silverpeas.dateReminder.persistent.PersistentResourceDateReminder
All Implemented Interfaces:
Serializable, Cloneable, Entity<PersistentResourceDateReminder,UuidIdentifier>

@Entity
public class PersistentResourceDateReminder
extends AbstractJpaEntity<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
static PersistentResourceDateReminder NONEDATEREMINDER
          Represents none dateReminder to replace in more typing way the null keyword.
 
Constructor Summary
PersistentResourceDateReminder()
           
 
Method Summary
 boolean exists()
          Indicates if the dateReminder is well registred
 DateReminderDetail getDateReminder()
           
<E,R extends EntityReference<E>>
R
getResource(Class<R> referenceClass)
          Gets a reference to the resource this dateReminder is for.
 String getResourceType()
          Get the resource type if the resource.
 boolean isDefined()
          Return true if resource is defined
 boolean notExists()
          Indicates if the dateReminder isn't registered.
 void setDateReminder(DateReminderDetail dateReminder)
          Sets the date, message, processStatus, creatorId and updaterId
 void setResource(EntityReference resource)
          Sets the resource to which this dateReminder belongs.
 String toString()
           
 void validate()
          Validates data
 
Methods inherited from class org.silverpeas.persistence.model.jpa.AbstractJpaEntity
getCreateDate, getCreatedBy, getEntityIdentifierClass, getId, getLastUpdateDate, getLastUpdatedBy, getVersion, isPersisted, markAsModified, newIdentifierInstance, setCreateDate, setCreatedBy, setId, setLastUpdateDate, setLastUpdatedBy, setVersion
 
Methods inherited from class org.silverpeas.persistence.model.AbstractEntity
clone, equals, getComponentInstanceId, getCreator, getLastUpdater, hasBeenModified, hashCode, performBeforePersist, performBeforeUpdate, setCreator, setLastUpdater
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

NONEDATEREMINDER

public static final PersistentResourceDateReminder NONEDATEREMINDER
Represents none dateReminder to replace in more typing way the null keyword.

Constructor Detail

PersistentResourceDateReminder

public PersistentResourceDateReminder()
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 the EntityReference. 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

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2016 Silverpeas. All Rights Reserved.