Spring Data Core

org.springframework.data.repository.core.support
Class DefaultRepositoryMetadata

java.lang.Object
  extended by org.springframework.data.repository.core.support.AbstractRepositoryMetadata
      extended by org.springframework.data.repository.core.support.DefaultRepositoryMetadata
All Implemented Interfaces:
RepositoryMetadata

public class DefaultRepositoryMetadata
extends AbstractRepositoryMetadata

Default implementation of RepositoryMetadata. Will inspect generic types of Repository to find out about domain and id class.

Author:
Oliver Gierke, Thomas Darimont

Constructor Summary
DefaultRepositoryMetadata(Class<?> repositoryInterface)
          Creates a new DefaultRepositoryMetadata for the given repository interface.
 
Method Summary
 Class<?> getDomainType()
          Returns the domain class the repository is declared for.
 Class<? extends Serializable> getIdType()
          Returns the id class the given class is declared for.
 
Methods inherited from class org.springframework.data.repository.core.support.AbstractRepositoryMetadata
getCrudMethods, getRepositoryInterface, getReturnedDomainClass, isPagingRepository
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultRepositoryMetadata

public DefaultRepositoryMetadata(Class<?> repositoryInterface)
Creates a new DefaultRepositoryMetadata for the given repository interface.

Parameters:
repositoryInterface - must not be null.
Method Detail

getDomainType

public Class<?> getDomainType()
Description copied from interface: RepositoryMetadata
Returns the domain class the repository is declared for.

Returns:
the domain class the repository is handling or null if none found.

getIdType

public Class<? extends Serializable> getIdType()
Description copied from interface: RepositoryMetadata
Returns the id class the given class is declared for.

Returns:
the id class of the entity managed by the repository for or null if none found.

Spring Data Core

Copyright © 2011-2014–2014 Pivotal Software, Inc.. All rights reserved.