001package com.avaje.ebean.annotation; 002 003import java.lang.annotation.ElementType; 004import java.lang.annotation.Retention; 005import java.lang.annotation.RetentionPolicy; 006import java.lang.annotation.Target; 007 008/** 009 * An annotation for declaring an index on a single column. 010 * 011 * @author rvbiljouw 012 */ 013@Target({ElementType.TYPE, ElementType.FIELD}) 014@Retention(RetentionPolicy.RUNTIME) 015public @interface Index { 016 017 /** 018 * Name of the index. If left blank a name is derived using the built in naming convention. 019 */ 020 String name() default ""; 021 022 /** 023 * If set true indicates this is a unique index. 024 */ 025 boolean unique() default false; 026 027 /** 028 * When placed on the class (rather than field) you can specify the columns 029 * to include in the index in order. 030 */ 031 String[] columnNames() default {}; 032 033}