Spring Data Commons

org.springframework.data.repository.core.support
Class DelegatingEntityInformation<T,ID extends Serializable>

java.lang.Object
  extended by org.springframework.data.repository.core.support.DelegatingEntityInformation<T,ID>
All Implemented Interfaces:
EntityInformation<T,ID>, EntityMetadata<T>

public class DelegatingEntityInformation<T,ID extends Serializable>
extends Object
implements EntityInformation<T,ID>

Useful base class to implement custom EntityInformations and delegate execution of standard methods from EntityInformation to a special implementation.

Author:
Oliver Gierke

Constructor Summary
DelegatingEntityInformation(EntityInformation<T,ID> delegate)
          Creates a new DelegatingEntityInformation delegating method invocations to the given EntityInformation.
 
Method Summary
 ID getId(T entity)
          Returns the id of the given entity.
 Class<ID> getIdType()
          Returns the type of the id of the entity.
 Class<T> getJavaType()
          Returns the actual domain class type.
 boolean isNew(T entity)
          Returns whether the given entity is considered to be new.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DelegatingEntityInformation

public DelegatingEntityInformation(EntityInformation<T,ID> delegate)
Creates a new DelegatingEntityInformation delegating method invocations to the given EntityInformation.

Parameters:
delegate -
Method Detail

getJavaType

public Class<T> getJavaType()
Description copied from interface: EntityMetadata
Returns the actual domain class type.

Specified by:
getJavaType in interface EntityMetadata<T>
Returns:

isNew

public boolean isNew(T entity)
Description copied from interface: EntityInformation
Returns whether the given entity is considered to be new.

Specified by:
isNew in interface EntityInformation<T,ID extends Serializable>
Parameters:
entity - must never be null
Returns:

getId

public ID getId(T entity)
Description copied from interface: EntityInformation
Returns the id of the given entity.

Specified by:
getId in interface EntityInformation<T,ID extends Serializable>
Parameters:
entity - must never be null
Returns:

getIdType

public Class<ID> getIdType()
Description copied from interface: EntityInformation
Returns the type of the id of the entity.

Specified by:
getIdType in interface EntityInformation<T,ID extends Serializable>
Returns:

Spring Data Commons

Copyright © 2012. All Rights Reserved.