cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r930743 - in /cayenne/main/trunk: framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/types/ framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/ framework/cayenne-jdk1.5-unpublished/src/main/j...
Date Sun, 04 Apr 2010 20:14:30 GMT
Author: aadamchik
Date: Sun Apr  4 20:14:30 2010
New Revision: 930743

URL: http://svn.apache.org/viewvc?rev=930743&view=rev
Log:
cleaning up deprecaed/unused stuff, javadocs, generics warnings, etc.

Modified:
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/types/EnumType.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/AutoAdapter.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/DbAdapter.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/db2/DB2Adapter.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/AbstractQuery.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/BaseQueryMetadata.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/SQLTemplate.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/SelectQuery.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/SelectQueryMetadata.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/SelectQueryPrefetchRouterAction.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/reflect/generic/DataObjectDescriptorFactory.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/ClientChannel.java
    cayenne/main/trunk/tutorials/tutorial/src/main/java/org/apache/cayenne/tutorial/Main.java

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/types/EnumType.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/types/EnumType.java?rev=930743&r1=930742&r2=930743&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/types/EnumType.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/types/EnumType.java
Sun Apr  4 20:14:30 2010
@@ -70,7 +70,7 @@ public class EnumType<T extends Enum<T>>
             int type,
             int precision) throws Exception {
 
-        if (value instanceof Enum) {
+        if (value instanceof Enum<?>) {
 
             Enum<?> e = (Enum<?>) value;
 

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/AutoAdapter.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/AutoAdapter.java?rev=930743&r1=930742&r2=930743&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/AutoAdapter.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/AutoAdapter.java
Sun Apr  4 20:14:30 2010
@@ -65,13 +65,10 @@ import org.apache.cayenne.query.SQLActio
  */
 public class AutoAdapter implements DbAdapter {
 
-    final static String DEFAULT_QUOTE_SQL_IDENTIFIERS_CHAR_START = "\"";
-    final static String DEFAULT_QUOTE_SQL_IDENTIFIERS_CHAR_END = "\"";
-
     /**
      * @deprecated since 3.1 in favor of
-     *             {@link org.apache.cayenne.configuration.server.DbAdapterFactory} configured
-     *             via dependency injection.
+     *             {@link org.apache.cayenne.configuration.server.DbAdapterFactory}
+     *             configured via dependency injection.
      */
     static final List<DbAdapterFactory> defaultFactories;
 
@@ -101,8 +98,8 @@ public class AutoAdapter implements DbAd
      * 
      * @since 3.0
      * @deprecated since 3.1 in favor of
-     *             {@link org.apache.cayenne.configuration.server.DbAdapterFactory} configured
-     *             via dependency injection.
+     *             {@link org.apache.cayenne.configuration.server.DbAdapterFactory}
+     *             configured via dependency injection.
      */
     public static void addFactory(DbAdapterFactory factory) {
         defaultFactories.add(factory);
@@ -113,8 +110,8 @@ public class AutoAdapter implements DbAd
      * by Cayenne.
      * 
      * @deprecated since 3.1 in favor of
-     *             {@link org.apache.cayenne.configuration.server.DbAdapterFactory} configured
-     *             via dependency injection.
+     *             {@link org.apache.cayenne.configuration.server.DbAdapterFactory}
+     *             configured via dependency injection.
      */
     public static DbAdapterFactory getDefaultFactory() {
         return new DbAdapterFactoryChain(defaultFactories);
@@ -131,7 +128,8 @@ public class AutoAdapter implements DbAd
     /**
      * Creates an AutoAdapter that can detect adapters known to Cayenne.
      * 
-     * @deprecated since 3.1 as {@link org.apache.cayenne.configuration.server.DbAdapterFactory}
+     * @deprecated since 3.1 as
+     *             {@link org.apache.cayenne.configuration.server.DbAdapterFactory}
      *             parameter is required.
      */
     public AutoAdapter(DataSource dataSource) {
@@ -143,8 +141,8 @@ public class AutoAdapter implements DbAd
      * adapterFactory is null, default factory is used.
      * 
      * @deprecated since 3.1 in favor of
-     *             {@link org.apache.cayenne.configuration.server.DbAdapterFactory} configured
-     *             via dependency injection.
+     *             {@link org.apache.cayenne.configuration.server.DbAdapterFactory}
+     *             configured via dependency injection.
      */
     public AutoAdapter(DbAdapterFactory adapterFactory, final DataSource dataSource) {
         // sanity check
@@ -217,8 +215,8 @@ public class AutoAdapter implements DbAd
      * the object creator.
      * 
      * @deprecated since 3.1 in favor of
-     *             {@link org.apache.cayenne.configuration.server.DbAdapterFactory} configured
-     *             via dependency injection.
+     *             {@link org.apache.cayenne.configuration.server.DbAdapterFactory}
+     *             configured via dependency injection.
      */
     protected DbAdapterFactory createDefaultFactory() {
         return getDefaultFactory();
@@ -353,14 +351,6 @@ public class AutoAdapter implements DbAd
         getAdapter().createTableAppendColumn(sqlBuffer, column);
     }
 
-    public String getIdentifiersStartQuote() {
-        return DEFAULT_QUOTE_SQL_IDENTIFIERS_CHAR_START;
-    }
-
-    public String getIdentifiersEndQuote() {
-        return DEFAULT_QUOTE_SQL_IDENTIFIERS_CHAR_END;
-    }
-
     public QuotingStrategy getQuotingStrategy(boolean isQuoteStrategy) {
         return getAdapter().getQuotingStrategy(isQuoteStrategy);
     }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/DbAdapter.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/DbAdapter.java?rev=930743&r1=930742&r2=930743&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/DbAdapter.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/DbAdapter.java
Sun Apr  4 20:14:30 2010
@@ -34,13 +34,9 @@ import org.apache.cayenne.query.Query;
 import org.apache.cayenne.query.SQLAction;
 
 /**
- * Defines API needed to handle differences between various databases accessed via JDBC.
- * Implementing classed are intended to be pluggable database-specific adapters.
- * DbAdapter-based architecture is introduced to solve the following problems:
- * <ul>
- * <li>Make Cayenne code independent from SQL syntax differences between different
RDBMS.
- * <li>Allow for vendor-specific tuning of JDBC access.
- * </ul>
+ * A Cayenne extension point that abstracts the differences between specifics of JDBC
+ * interfaces to various databases. Cayenne already ships with a number of built-in
+ * adapters for most common databases and users can provide their own custom adapters.
  */
 public interface DbAdapter {
 
@@ -186,5 +182,5 @@ public interface DbAdapter {
     /**
      * @since 3.0
      */
-    public QuotingStrategy getQuotingStrategy(boolean needQuotes);
+    QuotingStrategy getQuotingStrategy(boolean needQuotes);
 }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/db2/DB2Adapter.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/db2/DB2Adapter.java?rev=930743&r1=930742&r2=930743&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/db2/DB2Adapter.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/dba/db2/DB2Adapter.java
Sun Apr  4 20:14:30 2010
@@ -58,6 +58,7 @@ public class DB2Adapter extends JdbcAdap
     /**
      * Creates a DB2 specific PK Generator.
      */
+    @Override
     protected PkGenerator createPkGenerator() {
         return new DB2PkGenerator(this);
     }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/AbstractQuery.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/AbstractQuery.java?rev=930743&r1=930742&r2=930743&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/AbstractQuery.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/AbstractQuery.java
Sun Apr  4 20:14:30 2010
@@ -30,7 +30,6 @@ import org.apache.cayenne.util.ToStringB
 
 /**
  * A common superclass of Cayenne queries.
- * 
  */
 public abstract class AbstractQuery implements Query {
 
@@ -41,7 +40,6 @@ public abstract class AbstractQuery impl
     protected Object root;
     protected String name;
     protected DataMap dataMap;
-    
 
     /**
      * @since 3.1
@@ -56,8 +54,7 @@ public abstract class AbstractQuery impl
     public DataMap getDataMap() {
         return dataMap;
     }
-    
-    
+
     /**
      * @since 3.1
      */

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/BaseQueryMetadata.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/BaseQueryMetadata.java?rev=930743&r1=930742&r2=930743&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/BaseQueryMetadata.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/BaseQueryMetadata.java
Sun Apr  4 20:14:30 2010
@@ -99,7 +99,7 @@ class BaseQueryMetadata implements Query
             ObjEntity entity = null;
 
             if (root != null) {
-                if (root instanceof Class) {
+                if (root instanceof Class<?>) {
                     entity = resolver.lookupObjEntity((Class<?>) root);
                     if (entity == null) { // entity not found, try to resolve it with
                                           // client resolver

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/SQLTemplate.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/SQLTemplate.java?rev=930743&r1=930742&r2=930743&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/SQLTemplate.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/SQLTemplate.java
Sun Apr  4 20:14:30 2010
@@ -188,7 +188,7 @@ public class SQLTemplate extends Abstrac
             rootType = MapLoader.PROCEDURE_ROOT;
             rootString = ((Procedure) root).getName();
         }
-        else if (root instanceof Class) {
+        else if (root instanceof Class<?>) {
             rootType = MapLoader.JAVA_CLASS_ROOT;
             rootString = ((Class<?>) root).getName();
         }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/SelectQuery.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/SelectQuery.java?rev=930743&r1=930742&r2=930743&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/SelectQuery.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/SelectQuery.java
Sun Apr  4 20:14:30 2010
@@ -241,7 +241,7 @@ public class SelectQuery extends Qualifi
             rootType = MapLoader.PROCEDURE_ROOT;
             rootString = ((Procedure) root).getName();
         }
-        else if (root instanceof Class) {
+        else if (root instanceof Class<?>) {
             rootType = MapLoader.JAVA_CLASS_ROOT;
             rootString = ((Class<?>) root).getName();
         }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/SelectQueryMetadata.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/SelectQueryMetadata.java?rev=930743&r1=930742&r2=930743&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/SelectQueryMetadata.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/SelectQueryMetadata.java
Sun Apr  4 20:14:30 2010
@@ -124,6 +124,7 @@ class SelectQueryMetadata extends BaseQu
     /**
      * @since 3.0
      */
+    @Override
     public Map<String, String> getPathSplitAliases() {
         return pathSplitAliases != null ? pathSplitAliases : Collections
                 .<String, String> emptyMap();

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/SelectQueryPrefetchRouterAction.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/SelectQueryPrefetchRouterAction.java?rev=930743&r1=930742&r2=930743&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/SelectQueryPrefetchRouterAction.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/SelectQueryPrefetchRouterAction.java
Sun Apr  4 20:14:30 2010
@@ -27,6 +27,7 @@ import org.apache.cayenne.map.EntityInhe
 import org.apache.cayenne.map.EntityResolver;
 import org.apache.cayenne.map.ObjEntity;
 import org.apache.cayenne.map.ObjRelationship;
+import org.apache.cayenne.util.CayenneMapEntry;
 
 /**
  * Preprocessor and router of SelectQuery prefetches.
@@ -70,7 +71,7 @@ class SelectQueryPrefetchRouterAction im
         String prefetchPath = node.getPath();
 
         // find last relationship
-        Iterator it = entity.resolvePathComponents(prefetchPath);
+        Iterator<CayenneMapEntry> it = entity.resolvePathComponents(prefetchPath);
 
         ObjRelationship relationship = null;
         while (it.hasNext()) {

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/reflect/generic/DataObjectDescriptorFactory.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/reflect/generic/DataObjectDescriptorFactory.java?rev=930743&r1=930742&r2=930743&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/reflect/generic/DataObjectDescriptorFactory.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/reflect/generic/DataObjectDescriptorFactory.java
Sun Apr  4 20:14:30 2010
@@ -48,7 +48,7 @@ public class DataObjectDescriptorFactory
     }
 
     @Override
-    protected ClassDescriptor getDescriptor(ObjEntity entity, Class entityClass) {
+    protected ClassDescriptor getDescriptor(ObjEntity entity, Class<?> entityClass)
{
         if (!DataObject.class.isAssignableFrom(entityClass)) {
             return null;
         }
@@ -137,7 +137,7 @@ public class DataObjectDescriptorFactory
     protected Accessor createAccessor(
             PersistentDescriptor descriptor,
             String propertyName,
-            Class propertyType) throws PropertyException {
+            Class<?> propertyType) throws PropertyException {
         return new DataObjectAccessor(propertyName);
     }
 }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/ClientChannel.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/ClientChannel.java?rev=930743&r1=930742&r2=930743&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/ClientChannel.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/ClientChannel.java
Sun Apr  4 20:14:30 2010
@@ -129,7 +129,7 @@ public class ClientChannel implements Da
                 while (response.next()) {
                     if (response.isList()) {
 
-                        List objects = response.currentList();
+                        List<?> objects = response.currentList();
 
                         if (!objects.isEmpty()) {
 

Modified: cayenne/main/trunk/tutorials/tutorial/src/main/java/org/apache/cayenne/tutorial/Main.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/tutorials/tutorial/src/main/java/org/apache/cayenne/tutorial/Main.java?rev=930743&r1=930742&r2=930743&view=diff
==============================================================================
--- cayenne/main/trunk/tutorials/tutorial/src/main/java/org/apache/cayenne/tutorial/Main.java
(original)
+++ cayenne/main/trunk/tutorials/tutorial/src/main/java/org/apache/cayenne/tutorial/Main.java
Sun Apr  4 20:14:30 2010
@@ -23,7 +23,7 @@ import java.util.Collections;
 import java.util.GregorianCalendar;
 import java.util.List;
 
-import org.apache.cayenne.DataObjectUtils;
+import org.apache.cayenne.Cayenne;
 import org.apache.cayenne.ObjectContext;
 import org.apache.cayenne.access.DataContext;
 import org.apache.cayenne.exp.Expression;
@@ -99,7 +99,7 @@ public class Main {
 		Expression qualifier = ExpressionFactory.matchExp(Artist.NAME_PROPERTY,
 				"Pablo Picasso");
 		SelectQuery selectToDelete = new SelectQuery(Artist.class, qualifier);
-		Artist picasso = (Artist) DataObjectUtils.objectForQuery(context,
+		Artist picasso = (Artist) Cayenne.objectForQuery(context,
 				selectToDelete);
 
 		if (picasso != null) {



Mime
View raw message