org.surfnet.oaaas.model
Class AbstractEntity

java.lang.Object
  extended by org.surfnet.oaaas.model.AbstractEntity
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
AccessToken, AuthorizationRequest, Client, ResourceServer

@Entity
@AbstractEntityValid
public abstract class AbstractEntity
extends Object
implements Serializable

Abstract class that serves as root for Model object (e.g. that are stored in the repository)

See Also:
Serialized Form

Constructor Summary
AbstractEntity()
           
 
Method Summary
 boolean equals(Object other)
           
 Date getCreationDate()
           
 Long getId()
           
 Date getModificationDate()
           
 int hashCode()
           
 void setId(Long id)
           
 String toString()
           
 void updateTimeStamps()
           
 boolean validate(javax.validation.ConstraintValidatorContext context)
          Template method that validates the state of an AbstractEntity.
protected  void violation(javax.validation.ConstraintValidatorContext context, String message)
          Convenience method for adding a ConstraintViolation to the given context.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractEntity

public AbstractEntity()
Method Detail

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object other)
Overrides:
equals in class Object

getId

public Long getId()
Returns:
the id

setId

public void setId(Long id)
Parameters:
id - the id to set

toString

public String toString()
Overrides:
toString in class Object

validate

public boolean validate(javax.validation.ConstraintValidatorContext context)
Template method that validates the state of an AbstractEntity. Can be used prior to saving/ updating the AbstractEntity

Parameters:
context - the ConstraintValidatorContext

violation

protected void violation(javax.validation.ConstraintValidatorContext context,
                         String message)
Convenience method for adding a ConstraintViolation to the given context.

Parameters:
context - the ConstraintValidatorContext
message - the message to attach to the violation

updateTimeStamps

public void updateTimeStamps()

getCreationDate

public Date getCreationDate()

getModificationDate

public Date getModificationDate()


Copyright © 2012-2013 SURFnet bv, The Netherlands. All Rights Reserved.