Package dev.getelements.elements.sdk.dao
Interface MetadataDao
- All Known Implementing Classes:
MongoMetadataDao
public interface MetadataDao
This is the MetadataDao which is used to create, update, and retrieve metadata objects in the database.
-
Method Summary
Modifier and TypeMethodDescriptioncreateMetadata
(Metadata metadata) Creates a new metadata object.findMetadata
(String metadataId, User.Level accessLevel) Finds an active metadata object by the object id.findMetadataByName
(String metadataName, User.Level accessLevel) Finds an active metadata object by the object id.default Metadata
getMetadata
(String metadataId, User.Level accessLevel) Fetches a specificMetadata
instance based on ID.default Metadata
getMetadataByName
(String metadataName, User.Level accessLevel) Fetches a specificMetadata
instance based on ID.getMetadatas
(int offset, int count, User.Level accessLevel) Lists allMetadata
instances with the specified pagination constraints.searchMetadatas
(int offset, int count, String search, User.Level accessLevel) Lists allMetadata
instances, specifying a search query.void
softDeleteMetadata
(String metadataId) Deletes theMetadata
with the supplied metadata ID.updateMetadata
(Metadata metadata) Creates a new metadata object.
-
Method Details
-
getMetadatas
Lists allMetadata
instances with the specified pagination constraints.- Parameters:
offset
-count
-- Returns:
- a
Pagination
ofMetadata
instances
-
searchMetadatas
Lists allMetadata
instances, specifying a search query.- Parameters:
offset
-count
-search
-- Returns:
- a
Pagination
ofMetadata
instances
-
findMetadata
Finds an active metadata object by the object id. -
getMetadata
Fetches a specificMetadata
instance based on ID. If not found, an exception is raised.- Parameters:
metadataId
- the template ID- Returns:
- the
Metadata
, never null
-
findMetadataByName
Finds an active metadata object by the object id. -
getMetadataByName
Fetches a specificMetadata
instance based on ID. If not found, an exception is raised.- Parameters:
metadataName
- the template ID- Returns:
- the
Metadata
, never null
-
createMetadata
Creates a new metadata object.- Parameters:
metadata
-- Returns:
-
updateMetadata
Creates a new metadata object.- Parameters:
metadata
-- Returns:
-
softDeleteMetadata
Deletes theMetadata
with the supplied metadata ID.- Parameters:
metadataId
- the metadata ID.
-