From ef05b81014e51a80a8a2103188b67dd33ea6f1c9 Mon Sep 17 00:00:00 2001 From: rob bygrave Date: Sat, 9 Sep 2017 13:27:09 +1200 Subject: [PATCH] #1117 - Refactor - moved DbDefault and DbMigration annotations to ebean-annotation --- pom.xml | 2 +- .../java/io/ebean/annotation/DbDefault.java | 23 ------- .../java/io/ebean/annotation/DbMigration.java | 65 ------------------- 3 files changed, 1 insertion(+), 89 deletions(-) delete mode 100644 src/main/java/io/ebean/annotation/DbDefault.java delete mode 100644 src/main/java/io/ebean/annotation/DbMigration.java diff --git a/pom.xml b/pom.xml index 5b0d5a6b5..b6e085b68 100644 --- a/pom.xml +++ b/pom.xml @@ -87,7 +87,7 @@ io.ebean ebean-annotation - 2.3 + 2.4 diff --git a/src/main/java/io/ebean/annotation/DbDefault.java b/src/main/java/io/ebean/annotation/DbDefault.java deleted file mode 100644 index d330352d9..000000000 --- a/src/main/java/io/ebean/annotation/DbDefault.java +++ /dev/null @@ -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 EXPERMIENTAL 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(); -} diff --git a/src/main/java/io/ebean/annotation/DbMigration.java b/src/main/java/io/ebean/annotation/DbMigration.java deleted file mode 100644 index 091148e37..000000000 --- a/src/main/java/io/ebean/annotation/DbMigration.java +++ /dev/null @@ -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 EXPERMIENTAL 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: - *
-   * UPDATE table SET column = 'foo' WHERE column IS NULL
-   * 
- */ - 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 {}; - } -}