You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by aa...@apache.org on 2009/08/17 20:27:50 UTC

svn commit: r805087 - in /cayenne/main/trunk: docs/doc/src/main/resources/RELEASE-NOTES.txt framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/ObjAttributeInfoDialog.java

Author: aadamchik
Date: Mon Aug 17 18:27:50 2009
New Revision: 805087

URL: http://svn.apache.org/viewvc?rev=805087&view=rev
Log:
CAY-1227 Modeler support for flattened attributes

Modified:
    cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt
    cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/ObjAttributeInfoDialog.java

Modified: cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt?rev=805087&r1=805086&r2=805087&view=diff
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt (original)
+++ cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt Mon Aug 17 18:27:50 2009
@@ -18,6 +18,7 @@
 CAY-419 Collections aren't supported with in-memory filtering
 CAY-1116 Add generated PK support to SQLite
 CAY-1225 Controlling JDBC Driver setting "fetchSize" in a SelectQuery
+CAY-1227 Modeler support for flattened attributes
 CAY-1235 Implement qualifiers for DBEntities
 CAY-1236 Allow providing custom INSERT, UPDATE, DELETE query builders
 CAY-1241 Add method to ExpressionFactory to match against the primary key of an object or list of objects

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/ObjAttributeInfoDialog.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/ObjAttributeInfoDialog.java?rev=805087&r1=805086&r2=805087&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/ObjAttributeInfoDialog.java (original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/ObjAttributeInfoDialog.java Mon Aug 17 18:27:50 2009
@@ -139,7 +139,7 @@
                 getApplication().getBindingFactory(),
                 this);
         builder.bindToAction(view.getCancelButton(), "closeAction()");
-        builder.bindToAction(view.getSelectPathButton(), "setPath()");
+        builder.bindToAction(view.getSelectPathButton(), "setPath(true)");
         builder.bindToAction(view.getSaveButton(), "saveMapping()");
 
         /*
@@ -207,7 +207,7 @@
         view.dispose();
     }
 
-    public boolean setPath() {
+    public boolean setPath(boolean isChange) {
         StringBuilder attributePath = new StringBuilder();
         StringBuilder pathStr = new StringBuilder();
         TreePath path = view.getPathBrowser().getSelectionPath();
@@ -245,7 +245,7 @@
                     || !attribute.getName().equals(view.getAttributeName().getText())) {
                 attributeSaved.setDbAttributePath(attributePath.toString());
                 attributeSaved.setName(view.getAttributeName().getText());
-                if (!attribute.getDbAttributePath().equals(attributePath.toString())) {
+                if (!attribute.getDbAttributePath().equals(attributePath.toString()) && isChange) {
                     model.setUpdatedValueAt(attributeSaved.getDbAttributePath(), row, 3);
                 }
                 return true;
@@ -256,7 +256,7 @@
                     || !attribute.getName().equals(view.getAttributeName().getText())) {
                 attributeSaved.setDbAttributePath(attributePath.toString());
                 attributeSaved.setName(view.getAttributeName().getText());
-                if (attributePath.length() > 0) {
+                if (attributePath.length() > 0 && isChange) {
                     model.setUpdatedValueAt(attributeSaved.getDbAttributePath(), row, 3);
                 }
                 return true;
@@ -267,13 +267,14 @@
 
     public void saveMapping() {
 
-        if (setPath()) {
+        if (setPath(false)) {
             if (JOptionPane.showConfirmDialog(
                     (Component) getView(),
                     "You have changed Db Attribute path. Do you want it to be saved?",
                     "Save ObjAttribute",
                     JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
                 model.setUpdatedValueAt(attributeSaved.getName(), row, 1);
+                model.setUpdatedValueAt(attributeSaved.getDbAttributePath(), row, 3);
             }
         }