cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mgen...@apache.org
Subject [39/50] cayenne-modeler git commit: Extracted constants.
Date Thu, 05 Jan 2017 22:09:47 GMT
Extracted constants.


Project: http://git-wip-us.apache.org/repos/asf/cayenne-modeler/repo
Commit: http://git-wip-us.apache.org/repos/asf/cayenne-modeler/commit/5adedcb5
Tree: http://git-wip-us.apache.org/repos/asf/cayenne-modeler/tree/5adedcb5
Diff: http://git-wip-us.apache.org/repos/asf/cayenne-modeler/diff/5adedcb5

Branch: refs/heads/master
Commit: 5adedcb51baf0ffe6c8bdec4d316a898dc072528
Parents: ceebf01
Author: mrg <blacknext@gmail.com>
Authored: Mon Oct 10 08:39:01 2016 -0400
Committer: mrg <blacknext@gmail.com>
Committed: Mon Oct 10 08:39:01 2016 -0400

----------------------------------------------------------------------
 .../cayenne/modeler/adapters/DataMapAdapter.java       |  7 +++++--
 .../cayenne/modeler/adapters/DataNodeAdapter.java      |  4 +++-
 .../modeler/adapters/DatabaseEntityAdapter.java        |  4 +++-
 .../modeler/adapters/ObjectAttributeAdapter.java       | 13 +++++++++----
 .../cayenne/modeler/adapters/ObjectEntityAdapter.java  |  7 +++++--
 5 files changed, 25 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne-modeler/blob/5adedcb5/src/main/java/org/apache/cayenne/modeler/adapters/DataMapAdapter.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/cayenne/modeler/adapters/DataMapAdapter.java b/src/main/java/org/apache/cayenne/modeler/adapters/DataMapAdapter.java
index f5cfbe3..f999e04 100644
--- a/src/main/java/org/apache/cayenne/modeler/adapters/DataMapAdapter.java
+++ b/src/main/java/org/apache/cayenne/modeler/adapters/DataMapAdapter.java
@@ -32,6 +32,9 @@ import javafx.collections.ObservableList;
 
 public class DataMapAdapter extends CayennePropertyAdapter // implements AdapterSupport<DataMap>
 {
+    private static final String DATA_MAP_NAME         = "name";
+    private static final String QUOTE_SQL_IDENTIFIERS = "quotingSQLIdentifiers";
+
     private final DataMap dataMap;
 
     private final ObservableList<ObjectEntityAdapter>   objectEntityAdapters   = FXCollections.observableArrayList();
@@ -61,11 +64,11 @@ public class DataMapAdapter extends CayennePropertyAdapter // implements
Adapter
 
         try
         {
-            nameProperty = bindString("name");
+            nameProperty = bindString(DATA_MAP_NAME);
 //            locationProperty = JavaBeanStringPropertyBuilder.create().bean(dataMap).name("map").build();
 
             // TODO: Fix Cayenne?  The DEFAULT_QUOTE_SQL_IDENTIFIERS_PROPERTY constant is
incorrect.
-            quoteSQLIdentifiersProperty = bindBoolean("quotingSQLIdentifiers");
+            quoteSQLIdentifiersProperty = bindBoolean(QUOTE_SQL_IDENTIFIERS);
 
             defaultCatalogProperty = bindString(DataMap.DEFAULT_CATALOG_PROPERTY);
             defaultSchemaProperty  = bindString(DataMap.DEFAULT_SCHEMA_PROPERTY);

http://git-wip-us.apache.org/repos/asf/cayenne-modeler/blob/5adedcb5/src/main/java/org/apache/cayenne/modeler/adapters/DataNodeAdapter.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/cayenne/modeler/adapters/DataNodeAdapter.java b/src/main/java/org/apache/cayenne/modeler/adapters/DataNodeAdapter.java
index c1ca8fe..bd76063 100644
--- a/src/main/java/org/apache/cayenne/modeler/adapters/DataNodeAdapter.java
+++ b/src/main/java/org/apache/cayenne/modeler/adapters/DataNodeAdapter.java
@@ -25,6 +25,8 @@ import javafx.beans.property.StringProperty;
 
 public class DataNodeAdapter extends CayennePropertyAdapter
 {
+    private static final String DATA_NODE_NAME = "name";
+
     private StringProperty  nameProperty;
 
     private StringProperty  dataSourceLocationProperty;
@@ -40,7 +42,7 @@ public class DataNodeAdapter extends CayennePropertyAdapter
 
         try
         {
-            nameProperty                 = bindString("name");
+            nameProperty                 = bindString(DATA_NODE_NAME);
 //            dataSourceLocationProperty       = JavaBeanStringPropertyBuilder.create().bean(dataNode).name("dataSourceLocation").build();
 //            dataSourceFactoryProperty        = JavaBeanStringPropertyBuilder.create().bean(dataNode).name("dataSourceFactory").build();
 //            schemaUpdateStrategyNameProperty = JavaBeanStringPropertyBuilder.create().bean(dataNode).name("schemaUpdateStrategyName").build();

http://git-wip-us.apache.org/repos/asf/cayenne-modeler/blob/5adedcb5/src/main/java/org/apache/cayenne/modeler/adapters/DatabaseEntityAdapter.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/cayenne/modeler/adapters/DatabaseEntityAdapter.java
b/src/main/java/org/apache/cayenne/modeler/adapters/DatabaseEntityAdapter.java
index 3e741f1..8659bbf 100644
--- a/src/main/java/org/apache/cayenne/modeler/adapters/DatabaseEntityAdapter.java
+++ b/src/main/java/org/apache/cayenne/modeler/adapters/DatabaseEntityAdapter.java
@@ -30,6 +30,8 @@ import javafx.beans.property.StringProperty;
 
 public class DatabaseEntityAdapter extends CayennePropertyAdapter // implements AdapterSupport<DataMap>
 {
+    private static final String DATAASE_ENTITY_NAME = "name";
+
     private final DbEntity databaseEntity;
 //    private BeanPathAdapter<DataMap> dataMapAdapter;
 
@@ -59,7 +61,7 @@ public class DatabaseEntityAdapter extends CayennePropertyAdapter // implements
 
         try
         {
-            nameProperty = bindString("name");
+            nameProperty = bindString(DATAASE_ENTITY_NAME);
         }
         catch (final NoSuchMethodException e)
         {

http://git-wip-us.apache.org/repos/asf/cayenne-modeler/blob/5adedcb5/src/main/java/org/apache/cayenne/modeler/adapters/ObjectAttributeAdapter.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/cayenne/modeler/adapters/ObjectAttributeAdapter.java
b/src/main/java/org/apache/cayenne/modeler/adapters/ObjectAttributeAdapter.java
index bc2087e..c9ad1f4 100644
--- a/src/main/java/org/apache/cayenne/modeler/adapters/ObjectAttributeAdapter.java
+++ b/src/main/java/org/apache/cayenne/modeler/adapters/ObjectAttributeAdapter.java
@@ -27,6 +27,11 @@ import javafx.beans.property.StringProperty;
 
 public class ObjectAttributeAdapter extends CayennePropertyAdapter // implements AdapterSupport<DataMap>
 {
+    private static final String DATABASE_ATTRIBUTE_PATH = "dbAttributePath";
+    private static final String OBJECT_ATTRIBUTE_NAME   = "name";
+    private static final String OBJECT_ATTRIBUTE_TYPE   = "type";
+    private static final String USED_FOR_LOCKING        = "usedForLocking";
+
     private final ObjAttribute objectAttribute;
 
     private StringProperty nameProperty;
@@ -56,10 +61,10 @@ public class ObjectAttributeAdapter extends CayennePropertyAdapter //
implements
 
         try
         {
-            nameProperty                  = bindString("name");
-            javaTypeProperty              = bindString("type");
-            databaseAttributePathProperty = bindString("dbAttributePath");
-            usedForLockingProperty        = bindBoolean("usedForLocking");
+            nameProperty                  = bindString(OBJECT_ATTRIBUTE_NAME);
+            javaTypeProperty              = bindString(OBJECT_ATTRIBUTE_TYPE);
+            databaseAttributePathProperty = bindString(DATABASE_ATTRIBUTE_PATH);
+            usedForLockingProperty        = bindBoolean(USED_FOR_LOCKING);
 
 
 //            locationProperty = JavaBeanStringPropertyBuilder.create().bean(dataMap).name("map").build();

http://git-wip-us.apache.org/repos/asf/cayenne-modeler/blob/5adedcb5/src/main/java/org/apache/cayenne/modeler/adapters/ObjectEntityAdapter.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/cayenne/modeler/adapters/ObjectEntityAdapter.java b/src/main/java/org/apache/cayenne/modeler/adapters/ObjectEntityAdapter.java
index a2b00d9..f0bdfa7 100644
--- a/src/main/java/org/apache/cayenne/modeler/adapters/ObjectEntityAdapter.java
+++ b/src/main/java/org/apache/cayenne/modeler/adapters/ObjectEntityAdapter.java
@@ -28,6 +28,9 @@ import javafx.collections.ObservableList;
 
 public class ObjectEntityAdapter extends CayennePropertyAdapter // implements AdapterSupport<DataMap>
 {
+    private static final String ABSTRACT_CLASS     = "abstract";
+    private static final String OBJECT_ENTITY_NAME = "name";
+
     private final ObjEntity objectEntity;
 
     private final ObservableList<ObjectAttributeAdapter> objectAttributeAdapters =
FXCollections.observableArrayList();
@@ -57,8 +60,8 @@ public class ObjectEntityAdapter extends CayennePropertyAdapter // implements
Ad
 
         try
         {
-            nameProperty          = bindString("name");
-            abstractClassProperty = bindBoolean("abstract");
+            nameProperty          = bindString(OBJECT_ENTITY_NAME);
+            abstractClassProperty = bindBoolean(ABSTRACT_CLASS);
 
 
 //            locationProperty = JavaBeanStringPropertyBuilder.create().bean(dataMap).name("map").build();


Mime
View raw message