Class PersistentEntityResource
java.lang.Object
org.springframework.hateoas.RepresentationModel<EntityModel<T>>
org.springframework.hateoas.EntityModel<Object>
org.springframework.data.rest.webmvc.PersistentEntityResource
A Spring HATEOAS
EntityModel subclass that holds a reference to the entity's PersistentEntity
metadata.- Author:
- Jon Brisbin, Oliver Gierke, Dario Seidl
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder to createPersistentEntityResourceinstances. -
Method Summary
Modifier and TypeMethodDescriptionbuild(Object content, PersistentEntity<?, ?> entity) Creates a newPersistentEntityResource.Builderto createPersistentEntityResources eventually.Returns the resources that are supposed to be rendered in the_embeddedclause.PersistentEntity<?,? extends PersistentProperty<?>> Returns thePersistentEntityfor the underlying instance.Returns thePersistentPropertyAccessorfor the underlying content bean.Returns the underlying instance.booleanisNested()booleanisNew()Returns whether the content of the resource is a new entity about to be created.Methods inherited from class org.springframework.hateoas.EntityModel
equals, getContent, hashCode, of, of, of, toStringMethods inherited from class org.springframework.hateoas.RepresentationModel
add, add, add, addAllIf, addIf, getLink, getLink, getLinks, getLinks, getLinks, getRequiredLink, getRequiredLink, hasLink, hasLink, hasLinks, mapLink, mapLinkIf, removeLinks
-
Method Details
-
isNew
public boolean isNew()Returns whether the content of the resource is a new entity about to be created. Used to distinguish between creation and updates for incoming requests.- Returns:
-
isNested
public boolean isNested() -
getPersistentEntity
Returns thePersistentEntityfor the underlying instance.- Returns:
-
getTarget
Returns the underlying instance. If the instance is aTargetAware, theTargetAware's target is returned.- Returns:
- See Also:
-
getPropertyAccessor
Returns thePersistentPropertyAccessorfor the underlying content bean.- Returns:
-
getEmbeddeds
Returns the resources that are supposed to be rendered in the_embeddedclause.- Returns:
- the embeddeds
-
build
Creates a newPersistentEntityResource.Builderto createPersistentEntityResources eventually.- Parameters:
content- must not be null.entity- must not be null.- Returns:
-