ItemSchema

fun <T, PK : KeyType> ItemSchema(converter: ItemConverter<T>, partitionKey: KeySpec<PK>, attributes: Attributes = emptyAttributes()): ItemSchema.PartitionKey<T, PK>

Create a new item schema with a primary key consisting of a single partition key.

Parameters

converter

The ItemConverter used to convert between objects and items

partitionKey

The KeySpec for the partition key

attributes

An optional Attributes instance which may include additional metadata about the schema. If not provided, defaults to emptyAttributes.

Type Parameters

T

The type of objects described by this schema

PK

The type of the partition key property, either KeyType or one of its specific derivations


fun <T, PK : KeyType, SK : KeyType> ItemSchema(converter: ItemConverter<T>, partitionKey: KeySpec<PK>, sortKey: KeySpec<SK>, attributes: Attributes = emptyAttributes()): ItemSchema.CompositeKey<T, PK, SK>

Create a new item schema with a primary key consisting of a single partition key.

Parameters

converter

The ItemConverter used to convert between objects and items

partitionKey

The KeySpec for the partition key

sortKey

The KeySpec for the sort key

attributes

An optional Attributes instance which may include additional metadata about the schema. If not provided, defaults to emptyAttributes.

Type Parameters

T

The type of objects described by this schema

PK

The type of the partition key property, either KeyType or one of its specific derivations

SK

The type of the sort key property, either KeyType or one of its specific derivations