In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains "what is the Criteria Query of Hibernate". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "what is the Criteria Query of Hibernate"?
Criteria Query encapsulates the data query condition into an object through object-oriented design. To put it simply, Criteria Query can be seen as an object representation of traditional SQL, such as:
Criteria criteria=session.createCriteria (TUser.class); criteria.add (Expression.eq ("name", "Erica")); criteria.add (Expression.eq ("sex", new Integer (1))
The criteria instance here is essentially an encapsulation of SQL "select * from t_user where name='Erica' and sex=1". At run time, Hibernate generates the corresponding SQL statement based on the query criteria specified in Criteria.
Criteria query expression: Criteria itself is just a container, and the specific query conditions are added to the Criteria instance through the Criteria.add method.
Method description: Expression.eq corresponds to SQL "field=value" expression
For example, Expression.eq ("name", "Erica")
The Expression.allEq parameter is a Map object that contains multiple attribute-value relationships. Superimposed Expression.gt corresponding to multiple Expression.eq relationships corresponds to SQL "field > value" expression Expression.ge corresponds to SQL "field > = value" expression Expression.lt corresponds to SQL "fieldfield" Expression.gtProperty is used to compare values between two attributes, corresponding SQL "field > = field" Expression.ltProperty is used to compare values between two attributes, and corresponds to SQL "field"
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.