<- Back to NucleoCore
Skip to main content

Table Class

@Table(tableName = "author", dataEntryClass = AuthorDE.class)
public class Author implements Serializable {
  private static final long serialVersionUID = 1;
  
  @Index()
  String name;
  
  public Author() {}
  
  public Author(String name) {
    this.name = name;
  }
  
  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }
}

@Table

@Table(tableName = "author", dataEntryClass = AuthorDE.class)

tableName indicates the name of the table but also the topic that will be used by the MQS.

dataEntryClass points to the data entry class that encloses this table data class.

serialVersionUID

For the local cache this is needed for serializing and deserializing the data entries in the database. This will speed up startup for subsequent startups and will not grab all entries from the MQS.

@Index

This member variable will be indexed with the name of the variable. Nested objects in the data table class can also be indexed. You can specify the indexed key name by giving the Index annotation a value.

@Index("keyName")

When using a custom index key name you will need to use this key name for lookups.