karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cschnei...@apache.org
Subject [15/35] karaf-boot git commit: [jpa] Make annotations a bit more coherent
Date Mon, 09 May 2016 14:48:34 GMT
[jpa] Make annotations a bit more coherent

Project: http://git-wip-us.apache.org/repos/asf/karaf-boot/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf-boot/commit/dceec8d5
Tree: http://git-wip-us.apache.org/repos/asf/karaf-boot/tree/dceec8d5
Diff: http://git-wip-us.apache.org/repos/asf/karaf-boot/diff/dceec8d5

Branch: refs/heads/master
Commit: dceec8d5da3c942f34cdeacbfa3ec97d38055baa
Parents: 19a1877
Author: Guillaume Nodet <gnodet@apache.org>
Authored: Fri Apr 15 10:58:15 2016 +0200
Committer: Guillaume Nodet <gnodet@apache.org>
Committed: Fri Apr 15 10:58:15 2016 +0200

----------------------------------------------------------------------
 .../src/main/java/sample/jpa/Task.java          |   3 +-
 .../org/apache/karaf/boot/jpa/Hibernate.java    | 118 +++++++++----------
 2 files changed, 60 insertions(+), 61 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf-boot/blob/dceec8d5/karaf-boot-samples/karaf-boot-sample-jpa/src/main/java/sample/jpa/Task.java
----------------------------------------------------------------------
diff --git a/karaf-boot-samples/karaf-boot-sample-jpa/src/main/java/sample/jpa/Task.java b/karaf-boot-samples/karaf-boot-sample-jpa/src/main/java/sample/jpa/Task.java
index 63995c0..cd431a7 100644
--- a/karaf-boot-samples/karaf-boot-sample-jpa/src/main/java/sample/jpa/Task.java
+++ b/karaf-boot-samples/karaf-boot-sample-jpa/src/main/java/sample/jpa/Task.java
@@ -28,7 +28,8 @@ import org.apache.karaf.boot.jpa.Provider;
 @PersistentUnit(name = "tasklist", provider = Provider.Hibernate, properties = {
         @Property(name = "hibernate.hbm2ddl.auto", value = "create-drop")
 })
-@Hibernate.Dialect(Hibernate.DialectType.HSQL)
+@Hibernate.Dialect(Hibernate.Dialect.Value.HSQL)
+@Hibernate.Hbm2DdlAuto(Hibernate.Hbm2DdlAuto.Value.CreateDrop)
 @Entity
 @XmlRootElement
 public class Task {

http://git-wip-us.apache.org/repos/asf/karaf-boot/blob/dceec8d5/karaf-boot-starters/karaf-boot-starter-jpa/src/main/java/org/apache/karaf/boot/jpa/Hibernate.java
----------------------------------------------------------------------
diff --git a/karaf-boot-starters/karaf-boot-starter-jpa/src/main/java/org/apache/karaf/boot/jpa/Hibernate.java
b/karaf-boot-starters/karaf-boot-starter-jpa/src/main/java/org/apache/karaf/boot/jpa/Hibernate.java
index 06361d4..ae4dab3 100644
--- a/karaf-boot-starters/karaf-boot-starter-jpa/src/main/java/org/apache/karaf/boot/jpa/Hibernate.java
+++ b/karaf-boot-starters/karaf-boot-starter-jpa/src/main/java/org/apache/karaf/boot/jpa/Hibernate.java
@@ -20,73 +20,71 @@ public interface Hibernate {
     @Target(ElementType.TYPE)
     @Retention(RetentionPolicy.SOURCE)
     @interface Hbm2DdlAuto {
-        Hbm2DdlAutoType value();
+        Value value();
+        enum Value {
+            Validate,
+            Update,
+            Create,
+            CreateDrop;
+
+            public String toString() {
+                return super.toString().toLowerCase();
+            }
+        }
     }
 
     @ProviderProperty("hibernate.dialect")
     @Target(ElementType.TYPE)
     @Retention(RetentionPolicy.SOURCE)
     @interface Dialect {
-        DialectType value();
-    }
-
-    enum DialectType {
-        Cache71,
-        DataDirectOracle9,
-        DB2390,
-        DB2400,
-        DB2,
-        Derby,
-        Firebird,
-        FrontBase,
-        H2,
-        HSQL,
-        Informix,
-        Ingres10,
-        Ingres9,
-        Ingres,
-        Interbase,
-        JDataStore,
-        Mckoi,
-        MimerSQL,
-        MySQL5,
-        MySQL5InnoDB,
-        MySQL,
-        MySQLInnoDB,
-        MySQLMyISAM,
-        Oracle10g,
-        Oracle8i,
-        Oracle9,
-        Oracle9i,
-        Oracle,
-        Pointbase,
-        PostgresPlus,
-        PostgreSQL,
-        Progress,
-        RDMSOS2200,
-        SAPDB,
-        SQLServer2008,
-        SQLServer,
-        Sybase11,
-        SybaseAnywhere,
-        SybaseASE15,
-        Sybase,
-        Teradata,
-        TimesTen;
-
-        public String toString() {
-            return "org.hibernate.dialect." + super.toString() + "Dialect";
-        }
-    }
-
-    enum Hbm2DdlAutoType {
-        Validate,
-        Update,
-        Create,
-        CreateDrop;
+        Value value();
+        enum Value {
+            Cache71,
+            DataDirectOracle9,
+            DB2390,
+            DB2400,
+            DB2,
+            Derby,
+            Firebird,
+            FrontBase,
+            H2,
+            HSQL,
+            Informix,
+            Ingres10,
+            Ingres9,
+            Ingres,
+            Interbase,
+            JDataStore,
+            Mckoi,
+            MimerSQL,
+            MySQL5,
+            MySQL5InnoDB,
+            MySQL,
+            MySQLInnoDB,
+            MySQLMyISAM,
+            Oracle10g,
+            Oracle8i,
+            Oracle9,
+            Oracle9i,
+            Oracle,
+            Pointbase,
+            PostgresPlus,
+            PostgreSQL,
+            Progress,
+            RDMSOS2200,
+            SAPDB,
+            SQLServer2008,
+            SQLServer,
+            Sybase11,
+            SybaseAnywhere,
+            SybaseASE15,
+            Sybase,
+            Teradata,
+            TimesTen;
 
-        public String toString() {
-            return super.toString().toLowerCase();
+            public String toString() {
+                return "org.hibernate.dialect." + super.toString() + "Dialect";
+            }
         }
     }
 


Mime
View raw message