Skip to content

Instantly share code, notes, and snippets.

@cosbor11
Created April 4, 2016 02:58
Show Gist options
  • Select an option

  • Save cosbor11/ce4c0e9ce6affbb099e1c018d9ce605a to your computer and use it in GitHub Desktop.

Select an option

Save cosbor11/ce4c0e9ce6affbb099e1c018d9ce605a to your computer and use it in GitHub Desktop.
Define a Book entity with an indexed field genre
@Entity
public class Book extends ManagedEntity implements IManagedEntity
{
@Identifier(generator = IdentifierGenerator.SEQUENCE)
@Attribute
protected long bookId;
@Attribute
protected String title;
@Index
@Attribute
protected String genre;
@Attribute
protected String description;
// Getters and setters
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment