The names that are used in the query conditions, like salary or lastName, are the names of persistent fields. (In NDO 2.0 you can map not only fields, but also properties. In that case you use the property name in the query.) NDO translates them automatically to the corresponding database column names. The translation is based on the mapping file.
The NDO enhancer creates so called QueryHelper classes which make it possible to check the names used in the query. The QueryHelpers are described separately in the Chapter QueryHelper Classes.
If a class uses a field name, which is identical to a WHERE clause key word (like ‘between’) NDO might throw an exception. To prevent this, put the names in square brackets.
// field name = SQL keyword name
Query q = pc.NewQuery(typeof (DataContainer), "[between] LIKE 'T%'");
This has to be observed for all the following SQL keywords in a WHERE-clause, independent of upper and lower case: