You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-dev@db.apache.org by Robert Sfeir <ro...@codepuccino.com> on 2004/06/14 19:58:59 UTC

[PATCH] ClassDescritor more changes

Seems that not all changes I made got checked in for this file, so I'm 
resubmitting with more corrections.

Thanks
R


Re: [PATCH] ClassDescritor more changes

Posted by Jakob Braeuchi <jb...@gmx.ch>.
hi robert,

the patch is in cvs now.

thanks
jakob

Robert Sfeir wrote:

> Seems that not all changes I made got checked in for this file, so I'm 
> resubmitting with more corrections.
> 
> Thanks
> R
> 
> 
> ------------------------------------------------------------------------
> 
> Index: ClassDescriptor.java
> ===================================================================
> RCS file: /home/cvspublic/db-ojb/src/java/org/apache/ojb/broker/metadata/ClassDescriptor.java,v
> retrieving revision 1.86
> diff -u -r1.86 ClassDescriptor.java
> --- ClassDescriptor.java	13 Jun 2004 08:26:00 -0000	1.86
> +++ ClassDescriptor.java	14 Jun 2004 17:56:56 -0000
> @@ -1349,22 +1349,30 @@
>  
>          // comment on class
>          StringBuffer result = new StringBuffer(1024);
> -        result.append( eol + "  <!-- Mapping for Class " + this.getClassNameOfObject() + " -->" + eol );
> +        result.append( eol);
> +        result.append( "  <!-- Mapping for Class ");
> +        result.append( this.getClassNameOfObject());
> +        result.append( " -->");
> +        result.append( eol );
>  
>          // opening tag and attributes
> -        result.append( "  " + tags.getOpeningTagNonClosingById(CLASS_DESCRIPTOR) + eol );
> +        result.append( "  ");
> +        result.append( tags.getOpeningTagNonClosingById(CLASS_DESCRIPTOR));
> +        result.append( eol );
>  
>          // class
> -        result.append( "    " + tags.getAttribute(CLASS_NAME, this.getClassNameOfObject()) + eol );
> +        result.append( "    ");
> +        result.append( tags.getAttribute(CLASS_NAME, this.getClassNameOfObject()));
> +        result.append( eol );
>  
>          // isolation level is optional
>          if (null != getRepository())
>          {
>              if (getIsolationLevel() != this.getRepository().getDefaultIsolationLevel())
>              {
> -                result.append( "    "
> -                    + tags.getAttribute(ISOLATION_LEVEL, this.isolationLevelXml())
> -                    + eol );
> +                result.append( "    ");
> +                result.append( tags.getAttribute(ISOLATION_LEVEL, this.isolationLevelXml()) );
> +                result.append( eol );
>              }
>          }
>  
> @@ -1385,71 +1393,88 @@
>  	{
>  	    if (ProxyHelper.isNormalOjbProxy(theProxyClass))   // tomdz: What about VirtualProxy ?
>              {
> -        	result.append( "    " + tags.getAttribute(CLASS_PROXY, "dynamic") + eol );
> +        	result.append( "    ");
> +                result.append( tags.getAttribute(CLASS_PROXY, "dynamic"));
> +                result.append( eol );
>      	    }
>              else
>  	    {
> -    	        result.append( "    " + tags.getAttribute(CLASS_PROXY, this.getProxyClassName()) + eol );
> -            }
> -            result.append( "        " + tags.getAttribute(PROXY_PREFETCHING_LIMIT, "" + this.getProxyPrefetchingLimit()) + eol );
> +    	        result.append( "    ");
> +            result.append( tags.getAttribute(CLASS_PROXY, this.getProxyClassName()));
> +            result.append( eol );
> +            }
> +            result.append( "        ");
> +        result.append( tags.getAttribute(PROXY_PREFETCHING_LIMIT, "" + this.getProxyPrefetchingLimit()));
> +        result.append( eol );
>  	}
>  
>          // schema is optional
>          if (this.getSchema() != null)
>          {
> -            result.append( "    " + tags.getAttribute(SCHEMA_NAME, this.getSchema()) + eol );
> +            result.append( "    ");
> +            result.append( tags.getAttribute(SCHEMA_NAME, this.getSchema()));
> +            result.append( eol );
>          }
>  
>          // table name
>          if (this.getTableName() != null)
>          {
> -            result.append("    " + tags.getAttribute(TABLE_NAME, this.getTableName()) + eol );
> +            result.append("    ");
> +            result.append( tags.getAttribute(TABLE_NAME, this.getTableName()));
> +            result.append( eol );
>          }
>  
>          // rowreader is optional
>          if (this.getRowReaderClassName() != null)
>          {
> -            result.append( "    " + tags.getAttribute(ROW_READER, this.getRowReaderClassName()) + eol );
> +            result.append( "    ");
> +            result.append( tags.getAttribute(ROW_READER, this.getRowReaderClassName()));
> +            result.append( eol );
>          }
>  
>          //accept-locks is optional, enabled by default
>          if (!this.acceptLocks)
>          {
> -            result.append( "        " + tags.getAttribute(ACCEPT_LOCKS, "false") + eol );
> +            result.append( "        ");
> +            result.append( tags.getAttribute(ACCEPT_LOCKS, "false"));
> +            result.append( eol );
>          }
>          // sequence manager attribute not yet implemented
>  
>          // initialization method is optional
>          if (this.getInitializationMethod() != null)
>          {
> -            result.append( "    "
> -                + tags.getAttribute(INITIALIZATION_METHOD, this.getInitializationMethod().getName())
> -                + eol );
> +            result.append( "    ");
> +            result.append( tags.getAttribute(INITIALIZATION_METHOD, this.getInitializationMethod().getName()));
> +            result.append( eol );
>          }
>  
>          // factory class is optional
>          if (this.getFactoryClass() != null)
>          {
> -            result.append( "    "
> -                + tags.getAttribute(FACTORY_CLASS, this.getFactoryClass().getName())
> -                + eol );
> +            result.append( "    ");
> +            result.append( tags.getAttribute(FACTORY_CLASS, this.getFactoryClass().getName()) );
> +            result.append( eol );
>          }
>  
>          //	factory method is optional
>          if (this.getFactoryMethod() != null)
>          {
> -            result.append( "    "
> -                + tags.getAttribute(FACTORY_METHOD, this.getFactoryMethod().getName())
> -                + eol );
> +            result.append( "    ");
> +            result.append( tags.getAttribute(FACTORY_METHOD, this.getFactoryMethod().getName()) );
> +            result.append( eol );
>          }
>  
>          //reference refresh is optional, disabled by default
>          if (isAlwaysRefresh())
>          {
> -            result.append( "    " + tags.getAttribute(REFRESH, "true") + eol );
> +            result.append( "    ");
> +            result.append( tags.getAttribute(REFRESH, "true"));
> +            result.append( eol );
>          }
>  
> -        result.append( "  >" + eol );
> +        result.append( "  >");
> +        result.append( eol );
>  
>          // end of attributes
>  
> @@ -1459,9 +1484,12 @@
>              // extent-class
>              for (int i = 0; i < getExtentClassNames().size(); i++)
>              {
> -                result.append( "      " + tags.getOpeningTagNonClosingById(CLASS_EXTENT) + " " );
> +                result.append( "      ");
> +                result.append( tags.getOpeningTagNonClosingById(CLASS_EXTENT));
> +                result.append( " " );
>                  result.append( tags.getAttribute(CLASS_REF, getExtentClassNames().get(i).toString()) );
> -                result.append( " />" + eol );
> +                result.append( " />");
> +                result.append( eol );
>              }
>          }
>          else
> @@ -1471,9 +1499,12 @@
>              {
>                  for (int i = 0; i < getExtentClassNames().size(); i++)
>                  {
> -                    result.append( "      " + tags.getOpeningTagNonClosingById(CLASS_EXTENT) + " " );
> +                    result.append( "      ");
> +                    result.append( tags.getOpeningTagNonClosingById(CLASS_EXTENT));
> +                    result.append( " " );
>                      result.append( tags.getAttribute(CLASS_REF, getExtentClassNames().get(i).toString()) );
> -                    result.append( " />" + eol );
> +                    result.append( " />");
> +                    result.append( eol );
>                  }
>              }
>  
> @@ -1519,7 +1550,8 @@
>                  result.append( this.getDeleteProcedure().toXML() );
>              }
>          }
> -        result.append( "  " + tags.getClosingTagById(CLASS_DESCRIPTOR) );
> +        result.append( "  ");
> +        result.append( tags.getClosingTagById(CLASS_DESCRIPTOR) );
>          return result.toString();
>      }
>  
> 
> 
> 
> ------------------------------------------------------------------------
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org

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