db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b..@apache.org
Subject cvs commit: db-ojb/src/java/org/apache/ojb/broker/accesslayer/sql TableAliasHandler.java
Date Mon, 05 Dec 2005 19:58:53 GMT
brj         2005/12/05 11:58:53

  Modified:    src/java/org/apache/ojb/broker/accesslayer/sql
                        TableAliasHandler.java
  Log:
  improved handling of superclasses in pathclass  hints
  
  Revision  Changes    Path
  1.18      +13 -8     db-ojb/src/java/org/apache/ojb/broker/accesslayer/sql/TableAliasHandler.java
  
  Index: TableAliasHandler.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/accesslayer/sql/TableAliasHandler.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- TableAliasHandler.java	3 Dec 2005 19:51:53 -0000	1.17
  +++ TableAliasHandler.java	5 Dec 2005 19:58:52 -0000	1.18
  @@ -235,11 +235,11 @@
   
       }
    
  -	/**
  -	 * TODO: add super ClassDescriptor
  -	 * answer the ClassDescriptor for itemClass for an ObjectReferenceDescriptor
  -	 * check optional hint;
  -	 */
  +    /**
  +     * Answer the ClassDescriptor for itemClass for an ObjectReferenceDescriptor
  +     * check optional hint. The returned Class is to highest superclass contained in the
hint list. 
  +     * TODO: add super ClassDescriptor
  +     */
   	private ClassDescriptor getItemClassDescriptor(ObjectReferenceDescriptor ord, List hintClasses)
   	{   
           if (hintClasses == null || hintClasses.isEmpty())
  @@ -254,10 +254,15 @@
   		{
   			Class clazz = (Class) iter.next();
               Class superClazz = clazz.getSuperclass();
  -            
  +                       
  +            if (superClazz != null && resultClass.equals(superClazz.getSuperclass()))
  +            {
  +                continue; // skip if we already have a super superclass 
  +            }
  +
               if (hintClasses.contains(superClazz))
               {
  -                resultClass = superClazz;   // use superclass if it's in the hints
  +                resultClass = superClazz; // use superclass if it's in the hints
               }
   		}
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message