Enterprise Java Development@TOPIC@

Chapter 75. Criteria Functions

75.1. String Functions
75.1.1. Base Query
75.1.2. LOWER
75.1.3. UPPER
75.1.4. TRIM
75.1.5. CONCAT
75.1.6. LENGTH
75.1.7. LOCATE
75.1.8. SUBSTRING
75.2. Date Functions
75.3. Order By
75.4. Aggregate Functions
75.4.1. COUNT
75.4.2. MIN/MAX
75.4.3. SUM/AVE
75.5. Group By
75.6. Having
75.7. Summary




  • Located two Sales that occurred prior to today's date




  • Located no sales on today's date

  • Update with a bulk query

Note

Criteria API added Bulk Updates in JPA 2.1




  • Update all sales to today




  • Now locating sales for today's date

Note

Bulk commands (i.e., update) invalidate cached entities. You must refresh their state with the database or detach/clear them from the persistence context to avoid using out-dated information.




  • Note the ASC order on amount




  • Note the DESC order on amount



  • Get count of sales for each clerk




  • Provide a list of Clerks and their count of Sales for counts <= 1


  • Wed matched on Moe (1 sale) and Jack (0 sales)