14 criteria api

363 views

Published on

Published in: Technology, News & Politics
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
363
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
13
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

14 criteria api

  1. 1. Professional Open Source™ Criteria API© JBoss, Inc. 2003, 2004. 07/17/04 1
  2. 2. Professional Open Source™© JBoss, Inc. 2003, 2004. 2
  3. 3. Using Restrictions Professional Open Source™ from Book book where name=Hibernate Quickly© JBoss, Inc. 2003, 2004. 3
  4. 4. Getting Unique Result Professional Open Source™ For Ignoring case© JBoss, Inc. 2003, 2004. 4
  5. 5. Professional Open Source™© JBoss, Inc. 2003, 2004. 5
  6. 6. Professional Open Source™ Same as© JBoss, Inc. 2003, 2004. 6
  7. 7. Match modes Professional Open Source™  If you want to search using wildcards, you can use the MatchMode class The following MatchMode values are available: • START: Matches the start of the string with the pattern • END: Matches the end of the string with the pattern • ANYWHERE: Matches the pattern anywhere in the string • EXACT: Matches the complete pattern in the string© JBoss, Inc. 2003, 2004. 7
  8. 8. Projections Professional Open Source™ Same as© JBoss, Inc. 2003, 2004. 8
  9. 9. Professional Open Source™ Same as© JBoss, Inc. 2003, 2004. 9
  10. 10. Professional Open Source™ Same as© JBoss, Inc. 2003, 2004. 10
  11. 11. Grouping Professional Open Source™© JBoss, Inc. 2003, 2004. 11
  12. 12. Using Detached Criteria Professional Open Source™  If you don’t have an open session, you can instantiate a detached criteria by using the DetachedCriteria. forClass()  method and later attach it to a session for execution.  When you have a session to run the query, you call  getExecutableCriteria() and pass the session as a method argument. The getExecutableCriteria()  method returns an executable instance of criteria:© JBoss, Inc. 2003, 2004. 12

×