/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: MIT-0 * * Permission is hereby granted, free of charge, to any person obtaining a copy of this * software and associated documentation files (the "Software"), to deal in the Software * without restriction, including without limitation the rights to use, copy, modify, * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package software.amazon.samples.ddb.parallel.queries.sdk1; import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBAttribute; import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBAutoGeneratedKey; import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBHashKey; import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBIndexHashKey; import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBIndexRangeKey; import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBTable; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; /** * Modeling Order record * * @author zorani */ @Data @Builder @NoArgsConstructor @AllArgsConstructor @JsonInclude(JsonInclude.Include.NON_NULL) @DynamoDBTable(tableName="aws-blog-orders-table") public class Order { @JsonProperty("id") @DynamoDBAutoGeneratedKey @DynamoDBHashKey(attributeName="id") private String id; @JsonProperty("category") @DynamoDBIndexHashKey(attributeName="category", globalSecondaryIndexNames = {"category-order-date-index", "category-query-slot-mod64-index", "category-query-slot-mod128-index"}) private String category; @JsonProperty("country") @DynamoDBIndexHashKey(attributeName="country", globalSecondaryIndexName = "country-order-date-index") private String country; @JsonProperty("ck-country-state") @DynamoDBIndexHashKey(attributeName="ck-country-state", globalSecondaryIndexName = "ck-country-state-order-date-index") private String ckCountryState; @JsonProperty("sku") @DynamoDBIndexHashKey(attributeName="sku", globalSecondaryIndexName = "sku-order-date-index") private String sku; @JsonProperty("order-date") @DynamoDBIndexRangeKey(attributeName="order-date", globalSecondaryIndexNames = {"sku-order-date-index", "country-order-date-index", "category-order-date-index", "ck-country-state-order-date-index"}) private String orderDate; @JsonProperty("query-slot-mod64") @DynamoDBIndexRangeKey(attributeName="query-slot-mod64", globalSecondaryIndexName = "category-query-slot-mod64-index") private int querySlotMod64; @JsonProperty("query-slot-mod128") @DynamoDBIndexRangeKey(attributeName="query-slot-mod128", globalSecondaryIndexName = "category-query-slot-mod128-index") private int querySlotMod128; @JsonProperty("qty") @DynamoDBAttribute(attributeName="qty") private int qty; @JsonProperty("unit-price") @DynamoDBAttribute(attributeName="unit-price") private double pricePerUnit; @JsonProperty("state") @DynamoDBAttribute(attributeName="state") private String state; @JsonProperty("payment-type") @DynamoDBAttribute(attributeName="payment-type") private String paymentType; @JsonProperty("comment") @DynamoDBAttribute(attributeName="comment") private String comment; }