public class ReflectionEntityInformation<T,ID extends Serializable> extends AbstractEntityInformation<T,ID>
EntityInformation
implementation that inspects fields for an annotation and looks up this field's value to
retrieve the id.Constructor and Description |
---|
ReflectionEntityInformation(Class<T> domainClass)
Creates a new
ReflectionEntityInformation inspecting the given domain class for a field carrying the
Id annotation. |
ReflectionEntityInformation(Class<T> domainClass,
Class<? extends Annotation> annotation)
Creates a new
ReflectionEntityInformation inspecting the given domain class for a field carrying the given
annotation. |
Modifier and Type | Method and Description |
---|---|
ID |
getId(Object entity)
Returns the id of the given entity.
|
Class<ID> |
getIdType()
Returns the type of the id of the entity.
|
getJavaType, isNew
public ReflectionEntityInformation(Class<T> domainClass)
ReflectionEntityInformation
inspecting the given domain class for a field carrying the
Id
annotation.domainClass
- must not be null.public ReflectionEntityInformation(Class<T> domainClass, Class<? extends Annotation> annotation)
ReflectionEntityInformation
inspecting the given domain class for a field carrying the given
annotation.domainClass
- must not be null.annotation
- must not be null.public ID getId(Object entity)
EntityInformation
entity
- must never be nullpublic Class<ID> getIdType()
EntityInformation
Copyright © 2011-2013-2014 Pivotal. All Rights Reserved.