<commit_before>## Overview

Mid-level DynamoDB mapper/abstraction for Java using the v2 AWS SDK.

Warning: This package is provided for preview and comment purposes only.
It is not asserted to be stable or correct, and is subject to frequent
breaking changes.

## Getting Started
All the examples below use a fictional Customer class. This class is
completely made up and not part of this library. Any search or key
values used are also completely arbitrary.

### Initialization
1. Create or use a java class for mapping records to and from the
   database table. At a minimum you must annotate the class so that
   it can be used as a DynamoDb bean, and also the property that
   represents the primary partition key of the table. Here's an example:-
   ```java
   @DynamoDbBean
   public class Customer {
       private String accountId;
       private int subId;            // primitive types are supported
       private String name;
       private Instant createdDate;
       
       @DynamoDbPartitionKey
       public String getAccountId() { return this.accountId; }
       public void setAccountId(String accountId) { this.accountId = accountId; }
       
       @DynamoDbSortKey
       public int getSubId() { return this.subId; }
       public void setSubId(int subId) { this.subId = subId; }
       
       // Defines a GSI (customers_by_name) with a partition key of 'name'
       @DynamoDbSecondaryPartitionKey(indexNames = "customers_by_name")
       public String getName() { return this.name; }
       public void setName(String name) { this.name = name; }
       
       // Defines an LSI (customers_by_date) with a sort key of 'createdDate' and also declares the 
       // same attribute as a sort key for the GSI named 'customers_by_name'
       @DynamoDbSecondarySortKey(indexNames = {"customers_by_date", "customers_by_name"})
       public Instant getCreatedDate() { return this.createdDate; }
       public void setCreatedDate(Instant createdDate) { this.createdDate = createdDate; }
   }
   ```
   
2. Create a TableSchema for your class. For this example we are using the 'BeanTableSchema' that will scan your bean
   class and use the annotations to infer the table structure and attributes :
   ```java
   static final TableSchema<Customer> CUSTOMER_TABLE_SCHEMA = BeanTableSchema.create(Customer.class);
   ```
   
   If you would prefer to skip the slightly costly bean inference for a faster solution, you can instead declare your 
   schema directly and let the compiler do the heavy lifting. If you do it this way, your class does not need to follow
   bean naming standards nor does it need to be annotated. This example is equivalent to the bean example : 
   ```java
   static final TableSchema<Customer> CUSTOMER_TABLE_SCHEMA =
     StaticTableSchema.builder(Customer.class)
       .newItemSupplier(Customer::new)
       .addAttribute(String.class, a -> a.name("account_id")
                                         .getter(Customer::getAccountId)
                                         .setter(Customer::setAccountId)
                                         .tags(primaryPartitionKey()))<commit_msg>DynamoDb Enhanced: Small README.md adjustment demonstrating preferred interface for TableSchema creation<commit_after>## Overview

Mid-level DynamoDB mapper/abstraction for Java using the v2 AWS SDK.

Warning: This package is provided for preview and comment purposes only.
It is not asserted to be stable or correct, and is subject to frequent
breaking changes.

## Getting Started
All the examples below use a fictional Customer class. This class is
completely made up and not part of this library. Any search or key
values used are also completely arbitrary.

### Initialization
1. Create or use a java class for mapping records to and from the
   database table. At a minimum you must annotate the class so that
   it can be used as a DynamoDb bean, and also the property that
   represents the primary partition key of the table. Here's an example:-
   ```java
   @DynamoDbBean
   public class Customer {
       private String accountId;
       private int subId;            // primitive types are supported
       private String name;
       private Instant createdDate;
       
       @DynamoDbPartitionKey
       public String getAccountId() { return this.accountId; }
       public void setAccountId(String accountId) { this.accountId = accountId; }
       
       @DynamoDbSortKey
       public int getSubId() { return this.subId; }
       public void setSubId(int subId) { this.subId = subId; }
       
       // Defines a GSI (customers_by_name) with a partition key of 'name'
       @DynamoDbSecondaryPartitionKey(indexNames = "customers_by_name")
       public String getName() { return this.name; }
       public void setName(String name) { this.name = name; }
       
       // Defines an LSI (customers_by_date) with a sort key of 'createdDate' and also declares the 
       // same attribute as a sort key for the GSI named 'customers_by_name'
       @DynamoDbSecondarySortKey(indexNames = {"customers_by_date", "customers_by_name"})
       public Instant getCreatedDate() { return this.createdDate; }
       public void setCreatedDate(Instant createdDate) { this.createdDate = createdDate; }
   }
   ```
   
2. Create a TableSchema for your class. For this example we are using the 'bean' TableSchema that will scan your bean
   class and use the annotations to infer the table structure and attributes :
   ```java
   static final TableSchema<Customer> CUSTOMER_TABLE_SCHEMA = TableSchema.fromBean(Customer.class);
   ```
   
   If you would prefer to skip the slightly costly bean inference for a faster solution, you can instead declare your 
   schema directly and let the compiler do the heavy lifting. If you do it this way, your class does not need to follow
   bean naming standards nor does it need to be annotated. This example is equivalent to the bean example : 
   ```java
   static final TableSchema<Customer> CUSTOMER_TABLE_SCHEMA =
     TableSchema.builder(Customer.class)
       .newItemSupplier(Customer::new)
       .addAttribute(String.class, a -> a.name("account_id")
                                         .getter(Customer::getAccountId)
                                         .setter(Customer::setAccountId)
                                         .tags(primaryPartitionKey()))
{'fraction_non_alphanumeric': 0.061596480201131364, 'fraction_numerical': 0.0009428032683846638, 'mean_word_length': 2.916923076923077, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6709363', 'n_tokens_mistral': 1662, 'n_tokens_neox': 1606, 'n_words': 694}