John McNally wrote:
> 
> I am dropping my original proposal and if Eric does not come up with a
> preferred solution soon, we will probably accept yours.  I have some
> question on the toString() method.  Can the code be structured to append
> to a common StringBuffer?  As few conversion between String and
> StringBuffer as possible is a desired goal.

I was not so aware that String-concatenation is so expensive,
i.e. that it is implicitly done by converting to StringBuffer(?).
I guess, it would look like the following then:

  StringBuffer sb=new StringBuffer();
  sb.append("(");
  sb.append(object1.toString());
  if (connection_type==CONN_TYPE_AND)
   sb.append(Criterion.AND);
  else
   sb.append(Criterion.OR);
  sb.append(object2.toString());
  sb.append(")");
  return sb.toString();

Of course in analogy to appendPsTo one could use another method
than toString() to build the SQL using only StringBuffers. But this
would require changes in BasePeer at least.

Now, Eric did come up with (plans to) a better solution, so lets
see if we need this..

Florian Lindauer

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to