/*
 * Copyright 2015, Yahoo Inc.
 * Copyrights licensed under the Apache 2.0 License.
 * See the accompanying LICENSE file for terms.
 */
package com.yahoo.squidb.annotations;

import java.lang.annotation.ElementType;
import java.lang.annotation.Target;

/**
 * For declaring model classes that are backed by a SQLite table
 */
@Target(ElementType.TYPE)
public @interface TableModelSpec {

    /**
     * The name of the class to be generated
     */
    String className();

    /**
     * The name of the SQLite table for this model
     */
    String tableName();

    /**
     * Optional string for specifying table constraints when creating the table (raw SQL), e.g.
     * "FOREIGN KEY(key_col) REFERENCES other_table(_id) ON DELETE CASCADE" or "UNIQUE (col1, col2) ON CONFLICT
     * IGNORE". This value is ignored for virtual tables.
     */
    String tableConstraint() default "";

    /**
     * Optional string specifying the module used for creating a virtual table. If set, the generated model
     * will be a virtual table model.
     */
    String virtualModule() default "";

}

@@ -1087,10 +1087,388 @@
 lt %22%22;%0A%0A
+    /**%0A     * Optional flag to specify that the table model should not generate an explicit INTEGER PRIMARY KEY as an alias%0A     * to the table's rowid. This option should be enabled if some non-integer column is to be declared a primary key%0A     * or if a multi-column primary key is specified in %7B@link #tableConstraint()%7D.%0A     */%0A    boolean noRowIdAlias() default false;%0A%0A
 %7D%0A

Add a flag to TableModelSpec for disabling the automatic integer primary key rowid alias