4. Select the criteria for the query from the form
Although the previous method is simple, but not convenient for the user, the designer is also difficult to control, if implemented through the form, these problems can be solved.
As in the following form, the runtime user can select the driver's name in the combo box and press the query button to see the results of the query.
The following is a detailed list of the steps for the design:
Create a fo
Procedure Querylacklonorlattdcell (I_region_name varchar2, i_state varchar2) isbegin Select Region_name, state From gc3_td_site_history where 1 = 1 and region_name = decode (i_region_name, NULL, Region_name, i_ Region_name) and InStr (decode (i_state, NULL, State, i_state), state) > 0;end;If I_region_name is null, all region_name are queried; otherwise press I_region_name query.If i_state is null, all state is queried, and if I_state is "State1,state2", it is equivalent to
After sending the Hibernate query standard (Criteria) query page, a single record, and sorting, some netizens replied that the total number of data queries was reached. Today I will add the aggregation and grouping in the standard query.Querying the number of records is simple:Java codeCriteria crit = session. createCriteria (User. class );Crit. setProjection (Projections. rowCount ());Int v = (Integer) crit. uniqueResult ();Note that the setProjectio
5. Commonly used criteria expressions entered in the guidelines in the data if it is a date, Access will automatically be surrounded by #, if text is automatically used. The following is a list of commonly used expression formats for reference: Values Between #95 -1-1# and #96 -2-1# between 95-1-1 and 96-2-1 95-5-1,95-12-31 not "king Chic" is not King dashing King Moon , Zhang beautiful >=10 is greater than or equal to 10.5,11,100 year ([Transport Dat
HQL operator
QBC operator
Meaning
=
Restrictions.eq ()
equals equal
Restrictions.ne ()
Not equal to not equal
>
RESTRICTIONS.GT ()
Greater than greater than
>=
Restrictions.ge ()
Greater than or equal to greater than or equal
Restrictions.lt ()
Less than
Restrictions.le ()
Less than or equal to than or equal
Is null
Restri
1.Usesumproductmake a multi-conditional countSyntax:=Sumproduct ((conditions1) * (conditions2) * (conditions3) *... ..(conditionsN))function:statistics at the same time meet the conditions1, Conditions2to the conditionNthe number of records. Example:=sumproduct (a2:a10= "male") * (b2:b10=")Intermediate Title"))Formula Explanation:number of employees who have sex as a male and have an intermediate title2.Usesumproductmake multiple conditional sumsSyntax:=Sumproduct ((conditions1) * (conditions2)
4. Select a query from the form before the method, although simple, but for the user is not easy to operate, the designer is also difficult to control, if the form to implement, these problems can be solved. As in the following form, the runtime user can select the driver's name in the combo box and press the query button to see the results of the query.
The following is a detailed list of the steps for the design:
Create a form, press the Control Wizard button, and add a combo box to the fo
5. Commonly used criteria expression of
If the data entered in the guidelines is a date, Access will automatically surround with #, if text is used automatically.
Some commonly used expression formats are listed below for reference:
"
meaning
qualifying value
between #95 -1-1# and #96 -2-1# between 95-1-1 and 96-2-1
95-5-1,95-12-31
not "King Chic"
not Wang
> King Moon, Zhang beautif
Introduction to criteria in hibernate:To operate the database management system, the most basic thing is to use SQL (standard query language) statements. Most databases support standard SQL statements, however, there are also some database-specific SQL statements. When the application uses SQL statements for database queries, if the database-specific SQL statements are used, the program itself may be dependent on a specific database.
When using hiber
Http://docs.jboss.org/hibernate/orm/3.3/reference/en/html/querycriteria.html
When using criteria for Row-based query, you can combine the WHERE clause functions in SQL, you can also combine the query functions such as sorting, planning, and grouping.
Sort
You can use criteria to check the vulnerability and use Org. hibernate. criterion. sort the results by order, for example, using
Criteria -- object-oriented query of Hibernate
When talking about Hibernate queries, we often think of HQL, which makes our SQL statements object-oriented. In fact, it is similar to replacing the tables and fields in SQL statements with the corresponding entities and attributes. In fact, there is another Query method in Hibernate. We cannot see the shadow of the task SQL, that is, Criteria Query.
1,
Criteria
Hibernate designed the Criteriaspecification as the parent interface for criteria, and the criteria and Detachedcriteria are provided below.
2,
Detachedcriteria
Spring's Framework provides a gethibernatetemplate
(). Findbycriteria (Detachedcriteria) method makes it easy to return query knots according to Detachedcriteria
fruit.
Detache
In Atitit. Hibernate, Criteria uses summary and join queries and queries o9o and hibernatecriteria by sub-objects.
In Atitit. Hibernate, Criteria uses summary and association query and queries o9o by sub-Object
1. Criteria, Criterion, 13. Criteria blackhead configuration association query... 2
4. Ati Meata configurati
Method for Searching databases in criteria of Yii model operations, yiicriteria
This article describes how to use criteria to search for databases in Yii model operations. We will share this with you for your reference. The details are as follows:
Data Model search method:
Public function search () {// Warning: Please modify the following code to remove attributes that // shocould not be searched. $
The example in this article describes the method of finding a database for the criteria of YII model operations. Share to everyone for your reference, specific as follows:
Data Model Search methods:
Public Function Search ()
{
//Warning:please Modify the following code to remove attributes that
//should No t be searched.
$criteria =new Cdbcriteria;
$cri
Referring to hibernate queries, we tend to think of HQL, who makes our SQL statements object-oriented. In fact, a closer look at, is almost the SQL statement in the table and the field with the corresponding entities and attributes to replace. In fact, there is another way to query hibernate, we do not see the shadow of the task SQL, that is, criteria Query.Criteria is a more object-oriented query method than HQL. --Baidu EncyclopediaFirst, Brief intr
Java Filter mode (Filter/criteria pattern)
Filter pattern or Standard mode (criteria pattern) is a design pattern that allows developers to filter a set of objects using different criteria and connect them in a decoupled way by logical operation. This type of design pattern is a structured pattern that combines multiple crit
Atitit. in Hibernate, Criteria uses summary and association query and queries o9o1 based on sub-objects. criteria, Criterion, 12. configure a repeat Association for the main object blackhead. criteria blackhead configuration association query... 24. atiMeata configuration Association @ CriteriaRelt25. Association createCriteria () 36.Cr
Atitit. in Hibernate,
This article mainly introduces the method of finding database of the criteria of YII model operation, analyzes the examples of criteria in Yii model and the related skills of query operation, and the need of friends can refer to
This paper describes the method of finding a database for the criteria of YII model operation. Share to everyone for your reference, as
$criteria = new Cdbcriteria;Select$criteria->select = ' * ';//default *$criteria->select = ' id,name ';//field specified$criteria->select = ' t.*,t.id,t.name ';//connection query, the first table as T, so with t.*$criteria->distinct = FALSE; Whether the unique query Join$
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.