Annotation Reference - logitopia/jmortar-core-persistence GitHub Wiki

This part of the documentation will outline the available annotations, where they are used and what they are used for.

Persistence

The persistence annotation, usually named Persistent, is a class level annotation that is used to signify that a POJO is a model.

@DynamoDBPersistent
public class foo {

Attributes

The attributes available for this annotation are dependent on the persistence methods requirements. To find a list of attributes for your implementation, see the Javadoc for the persistent annotation.

@DynamoDBPersistent(
        credentialsProvider = "testCredentialsProvider",
        regions = "testRegions",
        noOfThreads = 3
)
public class foo {

Ignore

This class level annotation is not one that you would normally use in production. It was designed for use in a test configuration. It tells the builder to ignore this model. This means that no DAC or DAO will be built for it.

@Ignore
@DynamoDBPersistent
public class foo {

ReadOnlyEntity

This class-level annotation enables us to tell the builder that the model annotated with this is effectively "Read-Only" this means that it will be built with only a readable DAC and not a writable one.

This demonstrates one of the benefits of the data access component style. The modular functionality means that if we want to restrict the system from being able to write entries for an entity, we can easily do so.

@ReadOnlyEntity
@DynamoDBPersistent
public class foo {

Key

This annotation is a field-level annotation. It is used to tell the underlying storage medium which fields on the object comprise the key. It can be used across multiple fields depending on your requirement.

public class foo {
    
    @Key
    private String id;