Package org.springframework.data.mapping
Class TargetAwareIdentifierAccessor
java.lang.Object
org.springframework.data.mapping.TargetAwareIdentifierAccessor
- All Implemented Interfaces:
IdentifierAccessor
- Direct Known Subclasses:
IdPropertyIdentifierAccessor
IdentifierAccessor
that is aware of the target bean to obtain the identifier from so that it can generate a
more meaningful exception in case of an absent identifier and a call to getRequiredIdentifier()
.- Since:
- 2.0
- Author:
- Oliver Gierke, Mark Paluch
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the identifier of the underlying instance.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.mapping.IdentifierAccessor
getIdentifier
-
Constructor Details
-
TargetAwareIdentifierAccessor
-
-
Method Details
-
getRequiredIdentifier
Description copied from interface:IdentifierAccessor
Returns the identifier of the underlying instance. Implementations are strongly recommended to extends eitherTargetAwareIdentifierAccessor
or override this method to add more context to the exception being thrown in case of the absence of an identifier.- Specified by:
getRequiredIdentifier
in interfaceIdentifierAccessor
- Returns:
- the identifier of the underlying instance
-