nz.co.gregs.dbvolution.annotations.DBColumn Maven / Gradle / Ivy
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package nz.co.gregs.dbvolution.annotations;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
*
* Used to indicate that this field is associated with a database column and the
* name of that column.
*
*
* @DBColumn("my_column")
* public DBString myColumn = new DBString();
*
*
*
* DBColumn allows you to change the field name without affecting database
* functionality and is highly recommended.
*
*
* Using a QueryableDatatype is sufficient to indicate that the field is
* associated with a column, however this causes the class API to be tightly
* bound to the database and subtracts from the benefits of DBvolution.
*
*
* DBColumn is generated automatically by DBTableClassGenerator.
*
* Support DBvolution at
* Patreon
*
* @author Gregory Graham
* @see DBForeignKey
* @see DBPrimaryKey
* @see DBAutoIncrement
*/
@Target({ElementType.FIELD, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
public @interface DBColumn {
/**
* The raw column name as stored in the database.
*
* Support DBvolution at
* Patreon
*
* @return the raw column name from the database
*/
String value() default "";
}