1 22 23 package org.xquark.extractor.sql; 24 25 26 public class SqlUnOpIsNull extends SqlUnaryOperator 27 { 28 29 private static final String RCSRevision = "$Revision: 1.4 $"; 30 private static final String RCSName = "$Name: $"; 31 32 private boolean _notNull; 33 34 public SqlUnOpIsNull() { 35 } 36 37 public SqlUnOpIsNull(SqlExpression operand, boolean notNull) 38 { 39 super ( operand ) ; 40 setNot ( notNull ) ; 41 } 42 43 public SqlUnOpIsNull(SqlExpression operand) 44 { 45 super ( operand ) ; 46 setNot ( false ) ; 47 } 48 49 public void setNot(boolean notNull) 50 { 51 _notNull = notNull ; 52 } 53 54 public boolean getNot() 55 { 56 return _notNull ; 57 } 58 59 public String toSql(Context context) 60 { 61 63 StringBuffer retVal = new StringBuffer (); 64 retVal.append("("); 65 retVal.append(getOperand().toSql(context)); 66 retVal.append(")"); 67 68 if ( _notNull ) 69 { 70 retVal.append(" IS NOT NULL"); 71 } 72 else 73 { 74 retVal.append(" IS NULL"); 75 } 76 77 return retVal.toString(); 79 } 80 } 81 | Popular Tags |