Example usage for org.springframework.data.mapping.context MappingContextEvent getPersistentEntity

List of usage examples for org.springframework.data.mapping.context MappingContextEvent getPersistentEntity

Introduction

In this page you can find the example usage for org.springframework.data.mapping.context MappingContextEvent getPersistentEntity.

Prototype

public E getPersistentEntity() 

Source Link

Document

Returns the PersistentEntity the event was created for.

Usage

From source file:com.frank.search.solr.core.schema.SolrPersistentEntitySchemaCreator.java

@Override
public void onApplicationEvent(MappingContextEvent<?, ?> event) {

    if (features.contains(Feature.CREATE_MISSING_FIELDS)) {

        if (event.getPersistentEntity() instanceof SolrPersistentEntity) {
            SolrPersistentEntity<?> entity = (SolrPersistentEntity<?>) event.getPersistentEntity();
            if (!processed.contains(entity.getType())) {
                process(entity);//from   w w  w  .  j  av a  2 s  .c  o  m
            }
        }
    }
}