KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > sql > DisjunctionFragment


1 //$Id: DisjunctionFragment.java,v 1.1 2004/06/03 16:30:12 steveebersole Exp $
2
package org.hibernate.sql;
3
4 /**
5  * A disjunctive string of conditions
6  * @author Gavin King
7  */

8 public class DisjunctionFragment {
9
10     private StringBuffer JavaDoc buffer = new StringBuffer JavaDoc();
11
12     public DisjunctionFragment addCondition(ConditionFragment fragment) {
13         if ( buffer.length()>0 ) buffer.append(" or ");
14         buffer.append("(")
15             .append( fragment.toFragmentString() )
16             .append(")");
17         return this;
18     }
19
20     public String JavaDoc toFragmentString() {
21         return buffer.toString();
22     }
23 }
24
Popular Tags