Android Open Source - AndroidYboDb Column






From Project

Back to project page AndroidYboDb.

License

The source code is released under:

GNU Lesser General Public License

If you think the Android project AndroidYboDb 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

/*
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License.
 * //w  w  w.  j  av  a  2s  . co m
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 * 
 * Contributors:
 *     ybonnel - initial API and implementation
 */
package fr.ybo.database.annotation;

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

/**
 * Define a column of an entity.
 * 
 * @author ybonnel
 * 
 */
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface Column {
  enum TypeColumn {
    INTEGER("INTEGER"), TEXT("TEXT"), NUMERIC("NUMERIC"), BOOLEAN("INTEGER(1)"), DATE("INTEGER"), LIST_TEXT("TEXT");

    private final String sqlType;

    TypeColumn(String sqlType) {
      this.sqlType = sqlType;
    }

    public String getSqlType() {
      return sqlType;
    }
  }

  /**
   * Name of the column, use a field name if the name is not defined.
   */
  String name() default "";

  /**
   * Type of the column. TEXT by default.
   */
  Column.TypeColumn type() default Column.TypeColumn.TEXT;
  
  /**
   * True if the column must be not null. FALSE by default.
   */
  boolean notNull() default false;

}




Java Source Code List

com.android.demo.notepad1.NoteAdapter.java
com.android.demo.notepad1.NoteApplication.java
com.android.demo.notepad1.NoteEdit.java
com.android.demo.notepad1.Notepadv1.java
com.android.demo.notepad1.NotesDbAdapter.java
com.android.demo.notepad1.modele.Note.java
fr.ybo.database.DataBaseException.java
fr.ybo.database.DataBaseHelper.java
fr.ybo.database.annotation.Column.java
fr.ybo.database.annotation.Entity.java
fr.ybo.database.annotation.Indexed.java
fr.ybo.database.annotation.PrimaryKey.java
fr.ybo.database.modele.Base.java
fr.ybo.database.modele.Column.java
fr.ybo.database.modele.Table.java