private IndexedTypeIdentifier convertTypeIdentifier(Class<?> clazz) { return searchIntegrator.getIndexBindings().keyFromPojoType( clazz ); }
/** * It is not suggested to extend FullTextIndexEventListener, but when needed to implement special * use cases implementors might need this method. If you have to extent this, please report * your use case so that better long term solutions can be discussed. * * @param instance the object instance for which to retrieve the document builder * * @return the {@code DocumentBuilder} for the specified object */ protected AbstractDocumentBuilder getDocumentBuilder(final Object instance) { ExtendedSearchIntegrator integrator = getExtendedSearchFactoryIntegrator(); Class<?> clazz = instance.getClass(); IndexedTypeIdentifier type = integrator.getIndexBindings().keyFromPojoType( clazz ); EntityIndexBinding entityIndexBinding = integrator.getIndexBinding( type ); if ( entityIndexBinding != null ) { return entityIndexBinding.getDocumentBuilder(); } else { return integrator.getDocumentBuilderContainedEntity( type ); } }
@Override public <T> void purge(Class<T> entityType, Serializable id) { if ( entityType == null ) { return; } final ExtendedSearchIntegrator searchIntegrator = getSearchIntegrator(); final IndexedTypeIdentifier typeIdentifier = searchIntegrator.getIndexBindings().keyFromPojoType( entityType ); final IndexedTypeSet targetedClasses = getSearchIntegrator().getIndexedTypesPolymorphic( typeIdentifier.asTypeSet() ); if ( targetedClasses.isEmpty() ) { String msg = entityType.getName() + " is not an indexed entity or a subclass of an indexed entity"; throw new IllegalArgumentException( msg ); } for ( IndexedTypeIdentifier type : targetedClasses ) { if ( id == null ) { createAndPerformWork( type, null, WorkType.PURGE_ALL ); } else { createAndPerformWork( type, id, WorkType.PURGE ); } } }
Class<?> loadedType = instanceInitializer.getClass( o ); Object unproxiedObject = instanceInitializer.unproxy( o ); IndexedTypeIdentifier type = integrator.getIndexBindings().keyFromPojoType( loadedType ); DocumentBuilderIndexedEntity documentBuilder = getDocumentBuilder( type, integrator ); if ( documentBuilder == null ) {