Package io.dialob.db.spi.spring
Class ReflectionEntityInformation<T,ID extends Serializable>
- java.lang.Object
-
- org.springframework.data.repository.core.support.AbstractEntityInformation<T,ID>
-
- io.dialob.db.spi.spring.ReflectionEntityInformation<T,ID>
-
- All Implemented Interfaces:
org.springframework.data.repository.core.EntityInformation<T,ID>,org.springframework.data.repository.core.EntityMetadata<T>
public class ReflectionEntityInformation<T,ID extends Serializable> extends org.springframework.data.repository.core.support.AbstractEntityInformation<T,ID>EntityInformationimplementation that inspects fields for an annotation and looks up this field's value to retrieve the id.- Author:
- Oliver Gierke
-
-
Constructor Summary
Constructors Constructor Description ReflectionEntityInformation(Class<T> domainClass)Creates a newReflectionEntityInformationinspecting the given domain class for a field carrying theIdannotation.ReflectionEntityInformation(Class<T> domainClass, Class<? extends Annotation> annotation)Creates a newReflectionEntityInformationinspecting the given domain class for a field carrying the given annotation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IDgetId(Object entity)Class<ID>getIdType()-
Methods inherited from class org.springframework.data.repository.core.support.AbstractEntityInformation
getJavaType, isNew
-
-
-
-
Constructor Detail
-
ReflectionEntityInformation
public ReflectionEntityInformation(Class<T> domainClass)
Creates a newReflectionEntityInformationinspecting the given domain class for a field carrying theIdannotation.- Parameters:
domainClass- must not be null.
-
ReflectionEntityInformation
public ReflectionEntityInformation(Class<T> domainClass, Class<? extends Annotation> annotation)
Creates a newReflectionEntityInformationinspecting the given domain class for a field carrying the given annotation.- Parameters:
domainClass- must not be null.annotation- must not be null.
-
-