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.getAllMetadatasBySpec(String metadataSpecNameOrId) Lists allMetadatainstances with the specified pagination constraints.default MetadatagetMetadata(String metadataId, User.Level accessLevel) Fetches a specificMetadatainstance based on ID.default MetadatagetMetadataByName(String metadataName, User.Level accessLevel) Fetches a specificMetadatainstance based on ID.getMetadatas(int offset, int count, User.Level accessLevel) Lists allMetadatainstances with the specified pagination constraints.searchMetadatas(int offset, int count, String search, User.Level accessLevel) Lists allMetadatainstances, specifying a search query.voidsoftDeleteMetadata(String metadataId) Deletes theMetadatawith the supplied metadata ID.updateMetadata(Metadata metadata) Creates a new metadata object.
-
Method Details
-
getAllMetadatasBySpec
Lists allMetadatainstances with the specified pagination constraints.- Parameters:
metadataSpecNameOrId- the metadata spec name or id- Returns:
- a
PaginationofMetadatainstances
-
getMetadatas
Lists allMetadatainstances with the specified pagination constraints.- Parameters:
offset-count-- Returns:
- a
PaginationofMetadatainstances
-
searchMetadatas
Lists allMetadatainstances, specifying a search query.- Parameters:
offset-count-search-- Returns:
- a
PaginationofMetadatainstances
-
findMetadata
Finds an active metadata object by the object id. -
getMetadata
Fetches a specificMetadatainstance 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 specificMetadatainstance 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- the metadata object to create- Returns:
- the metadata object as it was written to the database
-
updateMetadata
Creates a new metadata object.- Parameters:
metadata- the metadata object to create- Returns:
- the metadata object as it was written to the database
-
softDeleteMetadata
Deletes theMetadatawith the supplied metadata ID.- Parameters:
metadataId- the metadata ID.
-