Package org.infinispan.query.impl
Class KeyTransformationHandlerIdentifierBridge
java.lang.Object
org.infinispan.query.impl.KeyTransformationHandlerIdentifierBridge
- All Implemented Interfaces:
AutoCloseable,IdentifierBridge<Object>
public class KeyTransformationHandlerIdentifierBridge
extends Object
implements IdentifierBridge<Object>
An
IdentifierBridge to map cache keys to the document identifiers.- Author:
- Fabio Massimo Ercoli
-
Method Summary
Modifier and TypeMethodDescriptionstatic BeanReference<? extends IdentifierBridge<Object>>createReference(KeyTransformationHandler keyTransformationHandler) fromDocumentIdentifier(String documentIdentifier, IdentifierBridgeFromDocumentIdentifierContext context) Transform the given document identifier value back to the value of the POJO property.toDocumentIdentifier(Object propertyValue, IdentifierBridgeToDocumentIdentifierContext context) Transform the given POJO property value to the value of the document identifier.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.hibernate.search.mapper.pojo.bridge.IdentifierBridge
close, isCompatibleWith, parseIdentifierLiteral
-
Method Details
-
createReference
public static BeanReference<? extends IdentifierBridge<Object>> createReference(KeyTransformationHandler keyTransformationHandler) -
toDocumentIdentifier
public String toDocumentIdentifier(Object propertyValue, IdentifierBridgeToDocumentIdentifierContext context) Description copied from interface:IdentifierBridgeTransform the given POJO property value to the value of the document identifier.Must return a unique value for each value of
propertyValue- Specified by:
toDocumentIdentifierin interfaceIdentifierBridge<Object>- Parameters:
propertyValue- The POJO property value to be transformed.context- A context that can beextendedto a more useful type, giving access to such things as a Hibernate ORM SessionFactory (if using the Hibernate ORM mapper).- Returns:
- The value of the document identifier.
-
fromDocumentIdentifier
public Object fromDocumentIdentifier(String documentIdentifier, IdentifierBridgeFromDocumentIdentifierContext context) Description copied from interface:IdentifierBridgeTransform the given document identifier value back to the value of the POJO property.Must be the exact inverse function of
IdentifierBridge.toDocumentIdentifier(Object, IdentifierBridgeToDocumentIdentifierContext), i.e.object.equals(fromDocumentIdentifier(toDocumentIdentifier(object, sessionContext)))must always be true.- Specified by:
fromDocumentIdentifierin interfaceIdentifierBridge<Object>- Parameters:
documentIdentifier- The document identifier value to be transformed.context- A sessionContext that can beextendedto a more useful type, giving access to such things as a Hibernate ORM Session (if using the Hibernate ORM mapper).- Returns:
- The value of the document identifier.
-