Xpo third-party control Learning (devexpress Persistent Object) series-Query

Source: Internet
Author: User

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.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.