StringDsbWhere.java 688 B

1234567891011121314151617181920212223242526272829
  1. package com.cnd3b.common;
  2. public class StringDsbWhere extends StringDsb{
  3. public StringBuffer strvalue;
  4. public StringDsbWhere(){
  5. strvalue=new StringBuffer(" 1=1 ");
  6. }
  7. public StringDsbWhere(String where){
  8. strvalue=new StringBuffer(" "+ where+" ");
  9. }
  10. public StringBuffer and(String str){
  11. strvalue.append(" and ("+str+")");
  12. return strvalue;
  13. }
  14. public String toString(){
  15. strvalue.insert(0,"(");
  16. strvalue.append(")");
  17. return strvalue.toString();
  18. }
  19. public static void main(String[] args) {
  20. StringDsbWhere stringDsb=new StringDsbWhere();
  21. stringDsb.and("t1.fname='123'");
  22. }
  23. }