Interface CMSVersionDao
- All Known Implementing Classes:
DefaultCMSVersionDao
public interface CMSVersionDao
The Interface CMSVersionDao for finding
CMSVersionModel objects.-
Method Summary
Modifier and TypeMethodDescriptionfindAllByItemUidAndItemCatalogVersion(String itemUid, CatalogVersionModel itemCatalogVersion) Finds allCMSVersionModelfor a givenCMSItemModelfindByItemUidAndLabel(String itemUid, String label, CatalogVersionModel itemCatalogVersion) Finds theCMSVersionModelfor an item identified by its itemUid containing the given labelFinds theCMSVersionModeluniquely identified by its uidfindPageVersionedByTransactionId(String transactionId) Finds the page associated to a transaction ID.
-
Method Details
-
findByUid
Finds theCMSVersionModeluniquely identified by its uid- Parameters:
uid- theCMSVersionModeluid- Returns:
- the
CMSVersionModelthat matches the criteria or empty if not found - Throws:
IllegalArgumentException- if uid is empty
-
findByItemUidAndLabel
Optional<CMSVersionModel> findByItemUidAndLabel(String itemUid, String label, CatalogVersionModel itemCatalogVersion) Finds theCMSVersionModelfor an item identified by its itemUid containing the given label- Parameters:
itemUid- the uid of the item modellabel- the label of the cms version modelitemCatalogVersion- theCatalogVersionModelto which the item belongs to- Returns:
- the
CMSVersionModelthat matches the criteria or empty if not found - Throws:
IllegalArgumentException- if either itemUid, label, or itemCatalogVersion is empty or null
-
findAllByItemUidAndItemCatalogVersion
List<CMSVersionModel> findAllByItemUidAndItemCatalogVersion(String itemUid, CatalogVersionModel itemCatalogVersion) Finds allCMSVersionModelfor a givenCMSItemModel- Parameters:
itemUid- the uid of theCMSItemModelitemCatalogVersion- theCatalogVersionModelto which theCMSItemModelbelongs.- Returns:
- A List of
CMSVersionModel
-
findPageVersionedByTransactionId
Finds the page associated to a transaction ID.When a page is versioned, the page and all its associated items are versioned. Each of them has a different version, but they all share the same transactionId; only one page can be associated to a transaction ID.
- Parameters:
transactionId- The ID of the transaction for which to find its associated page.- Returns:
- an
Optionalcontaining the page associated to the given transactionId; can beOptional#empty()when the transactionId identifies a transaction where a page was not versioned.
-