net.simonvt.schematic.annotation.Check Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of schematic-annotations Show documentation
Show all versions of schematic-annotations Show documentation
Automatically generate ContentProviders
package net.simonvt.schematic.annotation;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.CLASS;
/**
* Add CHECK constraint. Can be used on column level or on table level.
*
*
* @Check(NotesColumns.STATUS + " = '" + NotesColumns.STATUS_COMPLETED + "' and " + NotesColumns.COMPLETION_DATE + " is not null")
* public interface NotesColumns{
* String STATUS_NEW = "new";
* String STATUS_COMPLETED = "completed";
* @DataType(TEXT) @CHECK(NotesColumns.STATUS + " in ('"+NotesColumns.STATUS_NEW+"', '"+NotesColumns.STATUS_COMPLETED+"')") String STATUS = "status";
* @DataType(TEXT) String COMPLETION_DATE = "completion_date";
* }
*
*
*
*/
@Retention(CLASS) @Target({TYPE, FIELD})
public @interface Check {
/**
* CHECK constraint text. Shouldn't contain double quotes. Use single quote instead.
*/
String value();
}