public interface RoutingKeyBridge extends AutoCloseable
| Modifier and Type | Method and Description |
|---|---|
default void |
close()
Close any resource before the bridge is discarded.
|
String |
toRoutingKey(String tenantIdentifier,
Object entityIdentifier,
Object bridgedElement,
RoutingKeyBridgeToRoutingKeyContext context)
Generate a routing key using the given
tenantIdentifier, entityIdentifier and bridgedElement
as input and transforming them as necessary. |
String toRoutingKey(String tenantIdentifier, Object entityIdentifier, Object bridgedElement, RoutingKeyBridgeToRoutingKeyContext context)
tenantIdentifier, entityIdentifier and bridgedElement
as input and transforming them as necessary.
Warning: Reading from bridgedElement should be done with care.
Any read that was not declared during binding
(by declaring dependencies using RoutingKeyBindingContext.getDependencies()
or (advanced use) creating an accessor using RoutingKeyBindingContext.getBridgedElement())
may lead to out-of-sync indexes,
because Hibernate Search will consider the read property irrelevant to indexing
and will not reindex entities when that property changes.
tenantIdentifier - The tenant identifier currently in use (null if none).entityIdentifier - The value of the POJO property used to generate the document identifier,
i.e. the same value that was passed to IdentifierBridge.toDocumentIdentifier(Object, org.hibernate.search.mapper.pojo.bridge.runtime.IdentifierBridgeToDocumentIdentifierContext).bridgedElement - The element this bridge is applied to, from which data should be read.context - A context that can be
extended
to a more useful type, giving access to such things as a Hibernate ORM Session (if using the Hibernate ORM mapper).default void close()
close in interface AutoCloseableCopyright © 2006-2019 Red Hat, Inc. and others. Licensed under the GNU Lesser General Public License (LGPL), version 2.1 or later.