mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#1117 - Refactor - moved DbDefault and DbMigration annotations to ebean-annotation
This commit is contained in:
@@ -1,23 +0,0 @@
|
||||
package io.ebean.annotation;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* Annotation to specify a default value for DDL-generation & Migration.
|
||||
* This annotation is <b>EXPERMIENTAL</b> and may change.
|
||||
*
|
||||
* TODO: Move this annotation to eben-annotation package
|
||||
*
|
||||
* @author Roland Praml, FOCONIS AG
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.FIELD)
|
||||
public @interface DbDefault {
|
||||
/**
|
||||
* The defaultValue for the column.
|
||||
*/
|
||||
String value();
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
package io.ebean.annotation;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Repeatable;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import io.ebean.Platform;
|
||||
|
||||
/**
|
||||
* Annotation to specify details for DDL & Migration-generation. (e.g. defaults/renames/...)
|
||||
* This annotation is <b>EXPERMIENTAL</b> and may change.
|
||||
*
|
||||
* @author Roland Praml, FOCONIS AG
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.FIELD)
|
||||
@Repeatable(DbMigration.List.class)
|
||||
public @interface DbMigration {
|
||||
|
||||
/**
|
||||
* DdlScripts that will be executed before the 'alter' command.
|
||||
*
|
||||
* You may write a custom update routine here.
|
||||
* If you do not specify an SQL here, and this will alter the table
|
||||
* to a non-null column, ebean will autogenerate a statement from
|
||||
* default value like this:
|
||||
* <pre>
|
||||
* UPDATE table SET column = 'foo' WHERE column IS NULL
|
||||
* </pre>
|
||||
*/
|
||||
String[] preAlter() default {};
|
||||
|
||||
/**
|
||||
* DdlScript that will be executed after the 'alter' command
|
||||
*/
|
||||
String[] postAlter() default {};
|
||||
|
||||
/**
|
||||
* DdlScript that will be executed before the 'add' command
|
||||
*/
|
||||
String[] preAdd() default {};
|
||||
|
||||
/**
|
||||
* DdlScript that will be executed after the 'add' command.
|
||||
* You may write certain update scripts here.
|
||||
*/
|
||||
String[] postAdd() default {};
|
||||
|
||||
// TODO: Do we need preDrop / postDrop?
|
||||
|
||||
|
||||
Platform[] platforms() default {};
|
||||
|
||||
/**
|
||||
* Repeatable support for {@link DbMigration}.
|
||||
*/
|
||||
@Target({ ElementType.FIELD })
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@interface List {
|
||||
|
||||
DbMigration[] value() default {};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user