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
Modifier and TypeClassDescriptionstatic class
Builder to createPersistentEntityResource
instances. -
Method Summary
Modifier and TypeMethodDescriptionbuild
(Object content, PersistentEntity<?, ?> entity) Creates a newPersistentEntityResource.Builder
to createPersistentEntityResource
s eventually.Returns the resources that are supposed to be rendered in the_embedded
clause.PersistentEntity<?,
? extends PersistentProperty<?>> Returns thePersistentEntity
for the underlying instance.Returns thePersistentPropertyAccessor
for the underlying content bean.Returns the underlying instance.boolean
isNested()
boolean
isNew()
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, toString
Methods 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 thePersistentEntity
for the underlying instance.- Returns:
-
getTarget
Returns the underlying instance. If the instance is aTargetAware
, theTargetAware
's target is returned.- Returns:
- See Also:
-
getPropertyAccessor
Returns thePersistentPropertyAccessor
for the underlying content bean.- Returns:
-
getEmbeddeds
Returns the resources that are supposed to be rendered in the_embedded
clause.- Returns:
- the embeddeds
-
build
Creates a newPersistentEntityResource.Builder
to createPersistentEntityResource
s eventually.- Parameters:
content
- must not be null.entity
- must not be null.- Returns:
-