Identifier Annotation

The Identifier annotation indicates an attribute as the primary key. It will create a unique index based on the attribute values. The identifier is the sole indicator used to uniquely identify an entity within the database.

Attribute Type Default Description
generator Enum IdentifierGenerator.NONE Like most databases, Onyx provides a methodology for auto-generating your primary key. This is done using this attribute.
loadFactor Integer 5 (Value from 1-10) Load Factor indicates the scalability of the index. If you define 10, it is built to handle large data sets and not degrade over time. Alternatively 1 is for smallest data sets. The lower the load factor, the faster it will be for small amounts of records. This will also reduce the amount of disk space used.

The Identifier Generator can have the following values:

Value Description

IdentifierGenerator.NONE

The identifier will not be auto-generated.

IdentifierGenerator.SEQUENCE

By indicating an identifier with this generator, the numeric identifier will be auto incremented from maximum preceding values.

Using the Sequence generator it does not necessarily mean you cannot define your own identifier. You still have the option to define a numeric identifier.

  1. Attribute Annotation