Indexes are used to provide optimized query speed for entities in large data sets. Attributes are indexed by adding a simple annotation above the attribute declaration. Any kind of attribute can be indexed. Note: This will create a small overhead when persisting data.
You can download the code for this example here:
For this example, we have created some Books with genres. Notice, we have created several books with the same genre. An index does not have to be unique.
Our goal is to bring about change by enabling people to use simple and quality software in order to make sad engineers happy.