Package org.springframework.data.rest.core.event

Examples of org.springframework.data.rest.core.event.AfterCreateEvent


    appCtx.publishEvent(new BeforeCreateEvent(person));
  }

  @Test(expected = RuntimeException.class)
  public void shouldDispatchAfterCreate() throws Exception {
    appCtx.publishEvent(new AfterCreateEvent(person));
  }
View Full Code Here


  private ResponseEntity<ResourceSupport> createAndReturn(Object domainObject, RepositoryInvoker invoker,
      PersistentEntityResourceAssembler assembler) {

    publisher.publishEvent(new BeforeCreateEvent(domainObject));
    Object savedObject = invoker.invokeSave(domainObject);
    publisher.publishEvent(new AfterCreateEvent(savedObject));

    HttpHeaders headers = new HttpHeaders();
    addLocationHeader(headers, assembler, savedObject);

    PersistentEntityResource resource = config.isReturnBodyOnCreate() ? assembler.toFullResource(savedObject) : null;
View Full Code Here

TOP

Related Classes of org.springframework.data.rest.core.event.AfterCreateEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.