persistence icon indicating copy to clipboard operation
persistence copied to clipboard

support for conditional index

Open carmi2214 opened this issue 3 years ago • 0 comments

Hi, I think it would be very useful to add in Index.java a property called condition / where, to use in DB types that support the feature.

For example:

@Target({})
@Retention(RUNTIME)
public @interface Index {

    /**
     * (Optional) The name of the index; defaults to a provider-generated name.
     */
    String name() default "";

    /**
     * (Required) The names of the columns to be included in the index, 
     * in order.
     */
    String columnList();

    /**
     * (Optional) Whether the index is unique.
     */
    boolean unique() default false;

    /**
     * (Optional) The contents of the where clause while creating the index.
     */
    String where() default "";

}

Useful for indicies on tables with logical deletion, or many other cases

carmi2214 avatar Jan 22 '22 20:01 carmi2214