public interface IdentifiableContentBean extends ContentBean
getIdentifier()
must return
the unique identifier for this IdentifiableContentBean
: This is typically the identifier used in indexesModifier and Type | Method and Description |
---|---|
String |
getIdentifier()
This returns the identifier of the backing provider for this bean, for example some UUID or
/documents/content/myprojec/news/article or http://www.example.com/foo/bar, or a RDBMS id, etc
It is not allowed for any implementation to return
null |
default String |
getRepresentationId()
The representational id for a
IdentifiableContentBean is by default equal to the getIdentifier()
however implementations can change choose to return another id than the getIdentifier() . |
void |
setIdentifier(String identifier) |
@IndexField(name="id", ignoreInCompound=true) String getIdentifier()
This returns the identifier of the backing provider for this bean, for example some UUID or
/documents/content/myprojec/news/article or http://www.example.com/foo/bar, or a RDBMS id, etc
It is not allowed for any implementation to return null
Since the return value for this method is used as the index document identifier, it must be unique for every bean that must be indexed
IdentifiableContentBean
void setIdentifier(String identifier)
identifier
- sets the identifier for this IdentifiableContentBean
getIdentifier()
default String getRepresentationId()
IdentifiableContentBean
is by default equal to the getIdentifier()
however implementations can change choose to return another id than the getIdentifier()
.
An example of a subclass (interface) returning a different value is for example the HippoDocumentBean
, since
this one does return for getRepresentationId()
the id of the backing JCR handle uuid instead of the uuid
of the document variant.IdentifiableContentBean
Copyright © 2008–2020 Hippo B.V. (http://www.onehippo.com). All rights reserved.