Android Open Source - Android-Lib-Database Column






From Project

Back to project page Android-Lib-Database.

License

The source code is released under:

Apache License

If you think the Android project Android-Lib-Database listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package android.lib.database;
//from ww w  . j  a va 2  s .  co  m
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Marks a field as a table column.
 * <p>The class containing the annotated field must be annotated by {@link Table @Table}.</p>
 * <p>An annotated field can also be annotated by {@link Index @Index}.</p>
 * <p><p>SQLite-compatible types include <code>boolean</code>, <code>byte</code>, <code>byte[]</code>,
 * <code>double</code>, <code>float</code>, <code>int</code>, <code>long</code>, <code>short</code>
 * and <code>String</code>. If the type of the annotated field is not SQLite-compatible,
 * a {@link TypeConverter} is required for type conversion. Use <{@link UseConverter @UseConverter}
 * to indicate the {@link TypeConverter} to use for the annotated field.</p>
 * @see Table
 * @see Index
 * @see UseConverter
 */
@Target({ ElementType.FIELD })
@Retention(RetentionPolicy.RUNTIME)
public @interface Column {
    /**
     * The name of the table name.
     * <p>If not specified, the name in exact case of the annotated field will be used.</p>
     */
    String value() default "";

    /**
     * <code>true</code> if the column can be <code>null</code>; otherwise, <code>false</code>.
     * <p>{@link nullable} is ignored if {@link primaryKey} is <code>true</code>.</p>
     */
    boolean nullable() default true;

    /**
     * <code>true</code> if the column is a primary key; otherwise, <code>false</code>.
     * <p>Only one column within a table can be defined as primary key.</p>
     */
    boolean primaryKey() default false;

    /**
     * <code>true</code> if the primary key column is also an auto-increment column,
     * otherwise, <code>false</code>.
     * <p>{@link autoIncrement} is ignored if {@link primaryKey} is not set to <code>true</code>.</p>
     */
    boolean autoIncrement() default false;
}




Java Source Code List

android.lib.database.Column.java
android.lib.database.CompositeIndex.java
android.lib.database.DatabaseOpenHelper.java
android.lib.database.Database.java
android.lib.database.DateConverter.java
android.lib.database.Index.java
android.lib.database.JSONRowMapper.java
android.lib.database.RowMapper.java
android.lib.database.Table.java
android.lib.database.TypeConverter.java
android.lib.database.UniqueCompositeIndex.java
android.lib.database.UnsupportedTypeException.java
android.lib.database.UseConverter.java
android.lib.database.predicate.ManySidedPredicate.java
android.lib.database.predicate.Predicate.java
android.lib.database.predicate.ThreeSidedPredicate.java
android.lib.database.predicate.TwoSidedPredicate.java
android.lib.database.query.Delete.java
android.lib.database.query.Insert.java
android.lib.database.query.QueryBuilder.java
android.lib.database.query.Query.java
android.lib.database.query.Select.java
android.lib.database.query.Update.java