Convenience class to help composing select, insert and update statements. More...
Public Member Functions | |
| void | clear () |
| Clear the list. | |
| void | insert (String aKey, Mixed aValue) |
| Insert a key/value pair. | |
| Number | remove (String aKey) |
| Removes the value with the given key. | |
| SqlValues () | |
| Default constructor. | |
| String | toString () const |
| Mixed | value (String aName) |
| Get the named columns value. | |
Properties | |
| String | columns |
| The column names as comma separated list. | |
| String | condPairs |
| Pairs of "column=?", "column is null" or "(column is null or column='')" respectively as "and" separated list, as used for select conditions. | |
| Boolean | isEmpty |
| True if there are no columns. | |
| Array | keys |
| List of the keys. | |
| Object | object |
| The internal object holding the values. | |
| String | pairs |
| Pairs of "column=?" or "column=null" respectively as comma separated list, as used for update statements. | |
| String | tags |
| The value placeholders as comma separated list. | |
| Array | values |
| List of the values. | |
Convenience class to help composing select, insert and update statements.
Empty strings are handled like NULL in context of inserts and updates. In select conditions the database column is compared to both, NULL or '', if the string value is empty. This special handling is necessary because for Oracle NULL and '' are the same, however for PostgreSQL they are not.
| void bps::SqlValues::insert | ( | String | aKey, |
| Mixed | aValue | ||
| ) |
Insert a key/value pair.
| [in] | aKey | The key to insert |
| [in] | aValue | The value to insert |
| Number bps::SqlValues::remove | ( | String | aKey | ) |
Removes the value with the given key.
| [in] | aKey | The key of the pair to remove. |
| String bps::SqlValues::toString | ( | ) | const |
| Mixed bps::SqlValues::value | ( | String | aName | ) |
Get the named columns value.
| [in] | aName | Name of the column to get the value for. |