public interface ProductTypeDeleteCommand extends MetaModelReferenceExpansionDsl<ProductType,ProductTypeDeleteCommand,ProductTypeExpansionModel<ProductType>>, DeleteCommand<ProductType>
Delete by ID:
final ProductType productType = client().executeBlocking(ProductTypeCreateCommand.of(getDraft())); client().executeBlocking(ProductTypeDeleteCommand.of(productType)); final Query<ProductType> query = ProductTypeQuery.of() .withPredicates(m -> m.id().is(productType.getId())); assertThat(client().executeBlocking(query).head()).isEmpty();
See the test code.
Delete by key:
final ProductType productType = client().executeBlocking(ProductTypeCreateCommand.of(getDraft())); client().executeBlocking(ProductTypeDeleteCommand.ofKey(productType.getKey(), productType.getVersion())); final Query<ProductType> query = ProductTypeQuery.of() .withPredicates(m -> m.id().is(productType.getId())); assertThat(client().executeBlocking(query).head()).isEmpty();
See the test code.
ProductType
Modifier and Type | Method and Description |
---|---|
static ProductTypeDeleteCommand |
of(Versioned<ProductType> versioned)
Creates a command object to delete a
ProductType by ID. |
static ProductTypeDeleteCommand |
ofKey(String key,
Long version)
Creates a command object to delete a
ProductType by its key. |
plusExpansionPaths, withExpansionPaths
plusExpansionPaths, plusExpansionPaths, plusExpansionPaths, plusExpansionPaths, withExpansionPaths, withExpansionPaths, withExpansionPaths, withExpansionPaths
expansionPaths
canDeserialize, deserialize, httpRequestIntent
static ProductTypeDeleteCommand of(Versioned<ProductType> versioned)
ProductType
by ID.versioned
- the object to delete (so directly a ProductType
) or just the version/ID information of itstatic ProductTypeDeleteCommand ofKey(String key, Long version)
ProductType
by its key.key
- the key of the ProductType to delete, see ProductType.getKey()
version
- `the current version of the ProductType, see Resource.getVersion()