Telerik OpenAccess Classic

Telerik OpenAccess ORM Send comments on this topic.
Comparing Null Object References
See Also
Programmer's Guide > OpenAccess ORM Classic (Old API) > Telerik OpenAccess ORM OQL Reference > OQL - Object Query Language > The WHERE Clause > Comparing Null Object References

Glossary Item Box

This documentation article is a legacy resource describing the functionality of the deprecated OpenAccess Classic only. The contemporary documentation of Telerik OpenAccess ORM is available here.

If you want to search for an object or objects with an object reference that is set to null, you can use the nil keyword. The following example selects all Employee objects whose boss data-member is null.

OQL Copy Code
SELECT * FROM EmployeeExtent AS e
WHERE e.Employee1 = nil

It is also possible to use parameters to search for an object or objects with an object reference that is set to null, given below is an example:

OQL Copy Code
SELECT * FROM EmployeeExtent AS e
WHERE e.birthDate = $1

In the above example, $1 is a parameter that the user can pass. This parameter could also be null or any other valid value. 

See Also