All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.simonvt.schematic.annotation.Check Maven / Gradle / Ivy

There is a newer version: 0.7.0
Show newest version
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(); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy