Spring Data Commmons

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

java.lang.Object
  extended by org.springframework.data.repository.support.RepositorySupport<T,ID>
Type Parameters:
T - the type of entity to be handled
All Implemented Interfaces:
Repository<T,ID>

public abstract class RepositorySupport<T,ID extends Serializable>
extends Object
implements Repository<T,ID>

Abstract base class for generic repositories. Captures information about the domain class to be managed.

Author:
Oliver Gierke

Constructor Summary
RepositorySupport(Class<T> domainClass)
          Creates a new RepositorySupport.
 
Method Summary
protected abstract  IsNewAware createIsNewStrategy(Class<?> domainClass)
          Return whether the given entity is to be regarded as new.
protected  Class<T> getDomainClass()
          Returns the domain class to handle.
protected  IsNewAware getIsNewStrategy()
          Returns the strategy how to determine whether an entity is to be regarded as new.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.springframework.data.repository.Repository
count, delete, delete, deleteAll, exists, findAll, findById, save, save
 

Constructor Detail

RepositorySupport

public RepositorySupport(Class<T> domainClass)
Creates a new RepositorySupport.

Parameters:
domainClass -
Method Detail

getDomainClass

protected Class<T> getDomainClass()
Returns the domain class to handle.

Returns:
the domain class

createIsNewStrategy

protected abstract IsNewAware createIsNewStrategy(Class<?> domainClass)
Return whether the given entity is to be regarded as new. Default implementation will inspect the given domain class and use either PersistableEntityInformation if the class implements Persistable or ReflectiveEntityInformation otherwise.

Parameters:
entity -
Returns:

getIsNewStrategy

protected IsNewAware getIsNewStrategy()
Returns the strategy how to determine whether an entity is to be regarded as new.

Returns:
the isNewStrategy

Spring Data Commmons

Copyright © 2011. All Rights Reserved.