DataFaucet ORM

Null Filter

The statement object includes a nullFilter() method for convenience, just so you don't have to type out the whole filter method. The nullFilter() method includes two arguments - column name and nullability (default is true).

Example:

<cfscript>
  // get the datasource
  ds = request.DataFaucet.getDatasource(); 
  // get a select statement for the product table
  stmt = ds.getSelect("*","tblProduct"); 
  
  // find products with no category id 
  stmt.filter(column="productCategoryID",comparison="IS NULL"); 
  
  // or you can use the nullFilter method 
  stmt.nullFilter("procutCategoryID"); 
  
  // or get products that have recall dates (not null) 
  stmt.nullFilter("productRecallDate",false); 
  
  // get the query 
  query = stmt.execute(); 
</cfscript>