cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From and...@apache.org
Subject svn commit: r890504 - in /cayenne/main/trunk: docs/doc/src/main/resources/ framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/
Date Mon, 14 Dec 2009 22:25:45 GMT
Author: andrey
Date: Mon Dec 14 22:25:45 2009
New Revision: 890504

URL: http://svn.apache.org/viewvc?rev=890504&view=rev
Log:
CAY-1334 Modeler is trying to load data object classes when selecting a query

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/editor/ObjectQueryPropertiesPanel.java
    cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/SelectPropertiesPanel.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=890504&r1=890503&r2=890504&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 Dec 14 22:25:45 2009
@@ -24,10 +24,6 @@
 Bug Fixes Since 3.0:
 
 CAY-1304 Fix some failures in tests on SQLite
-CAY-1332 Embeddable validation error in CM on custom Java types
-CAY-1333 Entering a custom Java Type in CM for an ObjEntity blanks out DB fields
-CAY-1335 Modeler cannot unset inheritance
-
 
 ----------------------------------
 Release: 3.0 RC 1
@@ -44,6 +40,10 @@
 CAY-1307 Error committing CLOB on Oracle8
 CAY-1309 many validation errors when we remove dbEntity 
 CAY-1325 Stop bundling cayenne-agent.jar with the distro
+CAY-1332 Embeddable validation error in CM on custom Java types
+CAY-1333 Entering a custom Java Type in CM for an ObjEntity blanks out DB fields
+CAY-1334 Modeler is trying to load data object classes when selecting a query
+CAY-1335 Modeler cannot unset inheritance
 
 ----------------------------------
 Release: 3.0 beta 1

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjectQueryPropertiesPanel.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjectQueryPropertiesPanel.java?rev=890504&r1=890503&r2=890504&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjectQueryPropertiesPanel.java
(original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjectQueryPropertiesPanel.java
Mon Dec 14 22:25:45 2009
@@ -27,6 +27,7 @@
 
 import org.apache.cayenne.modeler.ProjectController;
 import org.apache.cayenne.query.Query;
+import org.apache.cayenne.query.SelectQuery;
 
 import com.jgoodies.forms.builder.PanelBuilder;
 import com.jgoodies.forms.layout.CellConstraints;
@@ -96,9 +97,6 @@
     public void initFromModel(Query query) {
         super.initFromModel(query);
 
-        dataRows
-                .setSelected(query
-                        .getMetaData(mediator.getCurrentDataDomain().getEntityResolver())
-                        .isFetchingDataRows());
+        dataRows.setSelected(((SelectQuery) query).isFetchingDataRows());
     }
 }

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/SelectPropertiesPanel.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/SelectPropertiesPanel.java?rev=890504&r1=890503&r2=890504&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/SelectPropertiesPanel.java
(original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/SelectPropertiesPanel.java
Mon Dec 14 22:25:45 2009
@@ -35,7 +35,6 @@
 import javax.swing.JPanel;
 import javax.swing.JTextField;
 
-import org.apache.cayenne.map.EntityResolver;
 import org.apache.cayenne.map.event.QueryEvent;
 import org.apache.cayenne.modeler.ProjectController;
 import org.apache.cayenne.modeler.util.CayenneWidgetFactory;
@@ -141,26 +140,28 @@
      * query is changed.
      */
     public void initFromModel(Query query) {
-        EntityResolver resolver = mediator.getCurrentDataDomain().getEntityResolver();
         DefaultComboBoxModel cacheModel = new DefaultComboBoxModel(CACHE_POLICIES);
-
-        QueryCacheStrategy selectedStrategy = query
-                .getMetaData(resolver)
-                .getCacheStrategy();
+        
+        // TODO (andrey, 15/12/09)
+        //do not use metadata, as it triggers CDO class loading (CAY-1334)
+        //to avoid this evil hack, we need some common interface for SelectQuery, EJBQL
+        // & SQLTemplate, but 3.0 API is frozen now
+        QueryCacheStrategy selectedStrategy = (QueryCacheStrategy)
+            PropertyUtils.getProperty(query, "cacheStrategy");
 
         cacheModel.setSelectedItem(selectedStrategy != null
                 ? selectedStrategy
                 : QueryCacheStrategy.getDefaultStrategy());
         cacheStrategy.setModel(cacheModel);
 
-        String[] cacheGroupsArray = query.getMetaData(resolver).getCacheGroups();
+        String[] cacheGroupsArray = (String[]) PropertyUtils.getProperty(query, "cacheGroups");
         cacheGroups.setText(toCacheGroupsString(cacheGroupsArray));
         setCacheGroupsEnabled(selectedStrategy != null
                 && selectedStrategy != QueryCacheStrategy.NO_CACHE);
 
-        fetchOffset.setText(String.valueOf(query.getMetaData(resolver).getFetchOffset()));
-        fetchLimit.setText(String.valueOf(query.getMetaData(resolver).getFetchLimit()));
-        pageSize.setText(String.valueOf(query.getMetaData(resolver).getPageSize()));
+        fetchOffset.setText(String.valueOf(PropertyUtils.getProperty(query, "fetchOffset")));
+        fetchLimit.setText(String.valueOf(PropertyUtils.getProperty(query, "fetchLimit")));
+        pageSize.setText(String.valueOf(PropertyUtils.getProperty(query, "pageSize")));
     }
 
     protected String toCacheGroupsString(String[] groups) {



Mime
View raw message