Condition object:
For example, freight <10 m
Dim orders as new xpcollection (<GetType> (Order ),_
New binaryoperator ("freight", 10d, binaryoperatortype. Less ))
The Collection class xpcollection object of the specified persistent class type is used here. This does not mean that only one table can be queried. If this persistent class is associated with other classes, the condition object can contain attribute conditions for the associated class. That is, multi-table queries are implemented. The address in the Combined Query below is a clustering class of customer.
Use groupoperator for complex conditions.
For example, birthdate <01/02/1960 and address. Street = '10' th Day''
Dim criteria as new groupoperator
Criteria. operands. Add (New binaryoperator ("birthdate", new datetime (1960, 1, 2), binaryoperatortype. Less ))
Criteria. operands. Add (New binaryoperator ("address. Street", "10 'th Avenue "))
'...
Dim xpc as new xpcollection (GetType (customer), criteria)
In the past, I also planned to create a component similar to this function in the project. At that time, I wanted to create a condition object irrelevant to the SQL Syntax of a specific database and use it to generate SQL condition statements. Later, I will give up on the project cost. Now there is a ready-made one.