public interface CategoryDeleteCommand extends MetaModelReferenceExpansionDsl<Category,CategoryDeleteCommand,CategoryExpansionModel<Category>>, DeleteCommand<Category>
final CategoryDraft draft = CategoryDraftBuilder.of(randomSlug(), randomSlug()).build(); final Category category = client().executeBlocking(CategoryCreateCommand.of(draft)); client().executeBlocking(CategoryDeleteCommand.of(category)); assertThat(client().executeBlocking(CategoryQuery.of().byId(category.getId())).head()).isEmpty();
See the test code.
Category
Modifier and Type | Method and Description |
---|---|
static CategoryDeleteCommand |
of(Versioned<Category> versioned)
Creates a command object to delete a
Category by ID. |
static CategoryDeleteCommand |
ofKey(String key,
Long version)
Creates a command object to delete a
Category by its key. |
plusExpansionPaths, withExpansionPaths
plusExpansionPaths, plusExpansionPaths, plusExpansionPaths, plusExpansionPaths, withExpansionPaths, withExpansionPaths, withExpansionPaths, withExpansionPaths
expansionPaths
canDeserialize, deserialize, httpRequestIntent
static CategoryDeleteCommand of(Versioned<Category> versioned)
Category
by ID.versioned
- the object to delete (so directly a Category
) or just the version/ID information of itstatic CategoryDeleteCommand ofKey(String key, Long version)
Category
by its key.key
- the key of the Category to delete, see Category.getKey()
version
- `the current version of the Category, see Resource.getVersion()