Changes for page HQL Scripting Examples in Velocity
Last modified by Manuel Leduc on 2023/02/02
From version 4.4
edited by Sergiu Dumitriu
on 2008/05/19
on 2008/05/19
Change comment:
Little explanation of what "use" means for the public API
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -23,7 +23,7 @@ 23 23 #set($query="where doc.creator='XWiki.VincentMassol'") 24 24 #set($results = $xwiki.searchDocuments($query, 5, 0)) 25 25 #foreach ($item in $results) 26 - * $item <br/>26 + * $item 27 27 #end 28 28 {code} 29 29 ... ... @@ -31,15 +31,13 @@ 31 31 #set($hql="where doc.creator='XWiki.VincentMassol'") 32 32 #displayQuery($hql false) 33 33 34 -<br/> 35 35 1.1.1 Ordered Query 36 36 #set($hql="where doc.creator='XWiki.VincentMassol' order by doc.date asc") 37 37 #displayQuery($hql false) 38 38 39 -<br/> 40 40 1.1.1 Advanced Query (date & time) 41 41 42 -Since there is no [standard way to calculate dates interval in HQL>http://opensource.atlassian.com/projects/hibernate/browse/HHH-2434] those queries are a bit unatural. 40 +Since there is no [standard way to calculate dates interval in HQL>http://opensource.atlassian.com/projects/hibernate/browse/HHH-2434] those queries are a bit unnatural. 43 43 44 44 #set($hql="where year(doc.date) = year(current_date()) and month(doc.date) = month(current_date()) and day(doc.date) = day(current_date()) and hour(doc.date) > (hour(current_time()) - 1) order by doc.date desc") 45 45 #displayQuery($hql false)