JavaXT
|
|
Filter ClassA Filter consists of one or more Filter.Items. Each Filter.Item consists of a field/column (e.g. "id"), an operator (e.g. "="), and a value constraint (e.g. "1"). Together, the Items can be joined to generate a "where" clause for a SQL query.
ConstructorsThere are no public constructors.Public Methodsset( String col, String op, Object val ) returns void Used to add, update, or remove an item in the filter. If an entry does not exist for a given col, a new item is created. If an entry does exist it is update or deleted, depending on whether val is null. add( String col, String op, Object val ) returns void Used to add an entry to the filter. Note that this may result in multiple entries for a given col. Use with caution. get( String col ) returns javaxt.utils.Value Returns a value for a given key in the filter. Always returns a javaxt.utils.Value object. Check the isNull() method to test for null values and the isArray() method to test if the javaxt.utils.Value object contains multiple values. Example:
javaxt.utils.Value val = item.get("test"); if (val.isNull()){ console.log(val); } else{ if (val.isArray()){ javaxt.utils.Value[] vals = (javaxt.utils.Value[]) val.toObject(); for (javaxt.utils.Value v : vals){ console.log(v); } } else{ console.log(val); } } Public Classes |