cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r647154 - in /cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/map: DataMap.java ObjEntity.java
Date Fri, 11 Apr 2008 13:10:40 GMT
Author: aadamchik
Date: Fri Apr 11 06:10:28 2008
New Revision: 647154

URL: http://svn.apache.org/viewvc?rev=647154&view=rev
Log:
CAY-868 Deprecate EventManager.getDefaultManager() and stop using it
(cleaning up bogus listeners)

Modified:
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/map/DataMap.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/map/ObjEntity.java

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/map/DataMap.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/map/DataMap.java?rev=647154&r1=647153&r2=647154&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/map/DataMap.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/map/DataMap.java
Fri Apr 11 06:10:28 2008
@@ -31,13 +31,9 @@
 import java.util.TreeMap;
 
 import org.apache.cayenne.map.event.AttributeEvent;
-import org.apache.cayenne.map.event.DbAttributeListener;
 import org.apache.cayenne.map.event.DbEntityListener;
-import org.apache.cayenne.map.event.DbRelationshipListener;
 import org.apache.cayenne.map.event.EntityEvent;
-import org.apache.cayenne.map.event.ObjAttributeListener;
 import org.apache.cayenne.map.event.ObjEntityListener;
-import org.apache.cayenne.map.event.ObjRelationshipListener;
 import org.apache.cayenne.map.event.RelationshipEvent;
 import org.apache.cayenne.project.Project;
 import org.apache.cayenne.query.NamedQuery;
@@ -52,14 +48,9 @@
  * Stores a collection of related mapping objects that describe database and object layers
  * of an application. DataMap contains DbEntities mapping database tables, ObjEntities -
  * mapping persistent Java classes, Procedures - mapping database stored procedures.
- * 
- * @author Michael Shengaout
- * @author Andrus Adamchik
- * @author Craig Miskell
  */
 public class DataMap implements Serializable, XMLSerializable, MappingNamespace,
-        DbEntityListener, DbAttributeListener, DbRelationshipListener, ObjEntityListener,
-        ObjAttributeListener, ObjRelationshipListener {
+        DbEntityListener, ObjEntityListener {
 
     /**
      * Defines whether a DataMap supports client entities.
@@ -659,14 +650,14 @@
     public Collection<Embeddable> getEmbeddables() {
         return Collections.unmodifiableCollection(embeddablesMap.values());
     }
-    
+
     /**
      * @since 3.0
      */
     public Map<String, SQLResultSetMapping> getResultSetMappingsMap() {
         return Collections.unmodifiableMap(resultSetMappings);
     }
-    
+
     /**
      * @since 3.0
      */
@@ -843,7 +834,7 @@
         // TODO: andrus, 1/25/2007 - clean up references like removeDbEntity does.
         embeddablesMap.remove(className);
     }
-    
+
     /**
      * @since 3.0
      */
@@ -1153,7 +1144,11 @@
         // does nothing currently
     }
 
-    /** Attribute property changed. */
+    /**
+     * Attribute property changed.
+     * 
+     * @deprecated since 3.0 DataMap no longer implements DbAttributeListener
+     */
     public void dbAttributeChanged(AttributeEvent e) {
         Entity entity = e.getEntity();
         if (entity instanceof DbEntity) {
@@ -1161,17 +1156,29 @@
         }
     }
 
-    /** New attribute has been created/added. */
+    /**
+     * New attribute has been created/added.
+     * 
+     * @deprecated since 3.0 DataMap no longer implements DbAttributeListener
+     */
     public void dbAttributeAdded(AttributeEvent e) {
         // does nothing currently
     }
 
-    /** Attribute has been removed. */
+    /**
+     * Attribute has been removed.
+     * 
+     * @deprecated since 3.0 DataMap no longer implements DbAttributeListener
+     */
     public void dbAttributeRemoved(AttributeEvent e) {
         // does nothing currently
     }
 
-    /** Relationship property changed. */
+    /**
+     * Relationship property changed.
+     * 
+     * @deprecated since 3.0 DataMap no longer implements DbRelationshipListener
+     */
     public void dbRelationshipChanged(RelationshipEvent e) {
         Entity entity = e.getEntity();
         if (entity instanceof DbEntity) {
@@ -1179,12 +1186,20 @@
         }
     }
 
-    /** Relationship has been created/added. */
+    /**
+     * Relationship has been created/added.
+     * 
+     * @deprecated since 3.0 DataMap no longer implements DbRelationshipListener
+     */
     public void dbRelationshipAdded(RelationshipEvent e) {
         // does nothing currently
     }
 
-    /** Relationship has been removed. */
+    /**
+     * Relationship has been removed.
+     * 
+     * @deprecated since 3.0 DataMap no longer implements DbRelationshipListener
+     */
     public void dbRelationshipRemoved(RelationshipEvent e) {
         // does nothing currently
     }
@@ -1231,32 +1246,56 @@
         // does nothing currently
     }
 
-    /** Attribute property changed. */
+    /**
+     * Attribute property changed.
+     * 
+     * @deprecated since 3.0 DataMap no longer implements ObjAttributeListener
+     */
     public void objAttributeChanged(AttributeEvent e) {
         // does nothing currently
     }
 
-    /** New attribute has been created/added. */
+    /**
+     * New attribute has been created/added.
+     * 
+     * @deprecated since 3.0 DataMap no longer implements ObjAttributeListener
+     */
     public void objAttributeAdded(AttributeEvent e) {
         // does nothing currently
     }
 
-    /** Attribute has been removed. */
+    /**
+     * Attribute has been removed.
+     * 
+     * @deprecated since 3.0 DataMap no longer implements ObjAttributeListener
+     */
     public void objAttributeRemoved(AttributeEvent e) {
         // does nothing currently
     }
 
-    /** Relationship property changed. */
+    /**
+     * Relationship property changed.
+     * 
+     * @deprecated since 3.0 DataMap no longer implements ObjRelationshipListener
+     */
     public void objRelationshipChanged(RelationshipEvent e) {
         // does nothing currently
     }
 
-    /** Relationship has been created/added. */
+    /**
+     * Relationship has been created/added.
+     * 
+     * @deprecated since 3.0 DataMap no longer implements ObjRelationshipListener
+     */
     public void objRelationshipAdded(RelationshipEvent e) {
         // does nothing currently
     }
 
-    /** Relationship has been removed. */
+    /**
+     * Relationship has been removed.
+     * 
+     * @deprecated since 3.0 DataMap no longer implements ObjRelationshipListener
+     */
     public void objRelationshipRemoved(RelationshipEvent e) {
         // does nothing currently
     }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/map/ObjEntity.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/map/ObjEntity.java?rev=647154&r1=647153&r2=647154&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/map/ObjEntity.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/map/ObjEntity.java
Fri Apr 11 06:10:28 2008
@@ -35,9 +35,7 @@
 import org.apache.cayenne.exp.ExpressionFactory;
 import org.apache.cayenne.map.event.AttributeEvent;
 import org.apache.cayenne.map.event.EntityEvent;
-import org.apache.cayenne.map.event.ObjAttributeListener;
 import org.apache.cayenne.map.event.ObjEntityListener;
-import org.apache.cayenne.map.event.ObjRelationshipListener;
 import org.apache.cayenne.map.event.RelationshipEvent;
 import org.apache.cayenne.util.CayenneMapEntry;
 import org.apache.cayenne.util.Util;
@@ -51,8 +49,7 @@
  * @author Misha Shengaout
  * @author Andrus Adamchik
  */
-public class ObjEntity extends Entity implements ObjEntityListener, ObjAttributeListener,
-        ObjRelationshipListener {
+public class ObjEntity extends Entity implements ObjEntityListener {
 
     final public static int LOCK_TYPE_NONE = 0;
     final public static int LOCK_TYPE_OPTIMISTIC = 1;
@@ -198,7 +195,7 @@
 
         // copy attributes
         for (Attribute attribute : getDeclaredAttributes()) {
-            entity.addAttribute(((ObjAttribute)attribute).getClientAttribute());
+            entity.addAttribute(((ObjAttribute) attribute).getClientAttribute());
         }
 
         // copy relationships; skip runtime generated relationships
@@ -214,7 +211,8 @@
                 continue;
             }
 
-            entity.addRelationship(((ObjRelationship)relationship).getClientRelationship());
+            entity.addRelationship(((ObjRelationship) relationship)
+                    .getClientRelationship());
         }
 
         // TODO: andrus 2/5/2007 - copy embeddables
@@ -745,7 +743,7 @@
 
         Collection<DbAttribute> pkAttributes = getDbEntity().getPrimaryKeys();
         Collection<String> ret = new ArrayList<String>(pkAttributes.size());
-        
+
         for (DbAttribute pk : pkAttributes) {
             ret.add(pk.getName());
         }
@@ -753,13 +751,12 @@
         return Collections.unmodifiableCollection(ret);
     }
 
-
     /**
      * Returns ObjRelationship of this entity that maps to <code>dbRelationship</code>
      * parameter. Returns null if no such relationship is found.
      */
     public ObjRelationship getRelationshipForDbRelationship(DbRelationship dbRelationship)
{
-        
+
         for (ObjRelationship objRel : getRelationshipMap().values()) {
             List<DbRelationship> relList = objRel.getDbRelationships();
             if (relList.size() != 1) {
@@ -834,7 +831,8 @@
     }
 
     @Override
-    public Iterator<CayenneMapEntry> resolvePathComponents(Expression pathExp) throws
ExpressionException {
+    public Iterator<CayenneMapEntry> resolvePathComponents(Expression pathExp)
+            throws ExpressionException {
 
         // resolve DB_PATH if we can
         if (pathExp.getType() == Expression.DB_PATH) {
@@ -1013,8 +1011,10 @@
             if (map != null) {
                 ObjEntity oe = (ObjEntity) e.getEntity();
                 for (Relationship relationship : oe.getRelationships()) {
-                    relationship = ((ObjRelationship)relationship).getReverseRelationship();
-                    if (null != relationship && relationship.targetEntityName.equals(oldName))
{
+                    relationship = ((ObjRelationship) relationship)
+                            .getReverseRelationship();
+                    if (null != relationship
+                            && relationship.targetEntityName.equals(oldName)) {
                         relationship.targetEntityName = newName;
                     }
                 }
@@ -1032,32 +1032,56 @@
         // does nothing currently
     }
 
-    /** Attribute property changed. */
+    /**
+     * Attribute property changed.
+     * 
+     * @deprecated since 3.0 ObjEntity no longer implements ObjAttributeListener
+     */
     public void objAttributeChanged(AttributeEvent e) {
         // does nothing currently
     }
 
-    /** New attribute has been created/added. */
+    /**
+     * New attribute has been created/added.
+     * 
+     * @deprecated since 3.0 ObjEntity no longer implements ObjAttributeListener
+     */
     public void objAttributeAdded(AttributeEvent e) {
         // does nothing currently
     }
 
-    /** Attribute has been removed. */
+    /**
+     * Attribute has been removed.
+     * 
+     * @deprecated since 3.0 ObjEntity no longer implements ObjAttributeListener
+     */
     public void objAttributeRemoved(AttributeEvent e) {
         // does nothing currently
     }
 
-    /** Relationship property changed. */
+    /**
+     * Relationship property changed.
+     * 
+     * @deprecated since 3.0 ObjEntity no longer implements ObjRelationshipListener
+     */
     public void objRelationshipChanged(RelationshipEvent e) {
         // does nothing currently
     }
 
-    /** Relationship has been created/added. */
+    /**
+     * Relationship has been created/added.
+     * 
+     * @deprecated since 3.0 ObjEntity no longer implements ObjRelationshipListener
+     */
     public void objRelationshipAdded(RelationshipEvent e) {
         // does nothing currently
     }
 
-    /** Relationship has been removed. */
+    /**
+     * Relationship has been removed.
+     * 
+     * @deprecated since 3.0 ObjEntity no longer implements ObjRelationshipListener
+     */
     public void objRelationshipRemoved(RelationshipEvent e) {
         // does nothing currently
     }



Mime
View raw message