1 | <?xml version="1.0" ?> |
---|
2 | <!DOCTYPE predefined-queries SYSTEM "predefined-queries.dtd" > |
---|
3 | <!-- |
---|
4 | $Id: common-queries.xml 1618 2007-05-09 13:53:02Z fredrik $ |
---|
5 | |
---|
6 | Copyright (C) 2007 Gregory Vincic |
---|
7 | |
---|
8 | This file is part of Proteios. |
---|
9 | Available at http://www.proteios.org/ |
---|
10 | |
---|
11 | Proteios is free software; you can redistribute it and/or |
---|
12 | modify it under the terms of the GNU General Public License |
---|
13 | as published by the Free Software Foundation; either version 2 |
---|
14 | of the License, or (at your option) any later version. |
---|
15 | |
---|
16 | Proteios is distributed in the hope that it will be useful, |
---|
17 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
18 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
19 | GNU General Public License for more details. |
---|
20 | |
---|
21 | You should have received a copy of the GNU General Public License |
---|
22 | along with this program; if not, write to the Free Software |
---|
23 | Foundation, Inc., 59 Temple Place - Suite 330, |
---|
24 | Boston, MA 02111-1307, USA. |
---|
25 | --> |
---|
26 | <!-- |
---|
27 | This XML file contains HQL and SQL queries that are common |
---|
28 | to all databases. If one of them happens to fail on your |
---|
29 | particular database, do not modify this file. Instead, you |
---|
30 | should add an entry into the file that is specific for your |
---|
31 | particular database that overrides the query in this file. |
---|
32 | For example, for MySQL modify the mysql-queries.xml. |
---|
33 | --> |
---|
34 | <predefined-queries> |
---|
35 | |
---|
36 | <query id="LOAD_SYSTEM_ITEMS" type="HQL"> |
---|
37 | <sql> |
---|
38 | SELECT item.id, item.systemId |
---|
39 | FROM org.proteios.core.data.SystemData item |
---|
40 | WHERE NOT item.systemId IS NULL |
---|
41 | </sql> |
---|
42 | <description> |
---|
43 | Load the ID and systemID, in that order, of all SystemData |
---|
44 | items. |
---|
45 | </description> |
---|
46 | </query> |
---|
47 | |
---|
48 | <query id="LOAD_ROLE_KEY_IDS" type="HQL"> |
---|
49 | <sql> |
---|
50 | SELECT rk.id, rk.itemType |
---|
51 | FROM RoleKeyData rk |
---|
52 | </sql> |
---|
53 | <description> |
---|
54 | Load the ID and itemType, in that order, of all RoleKeyData |
---|
55 | items. |
---|
56 | </description> |
---|
57 | </query> |
---|
58 | |
---|
59 | <query id="GET_USER_FOR_LOGIN" type="HQL"> |
---|
60 | <sql> |
---|
61 | SELECT usr |
---|
62 | FROM UserData usr |
---|
63 | WHERE usr.login = :login |
---|
64 | </sql> |
---|
65 | <description> |
---|
66 | Load a user when you know the login. |
---|
67 | </description> |
---|
68 | </query> |
---|
69 | |
---|
70 | <query id="GET_USER_FOR_EXTERNAL_ID" type="HQL"> |
---|
71 | <sql> |
---|
72 | SELECT usr |
---|
73 | FROM UserData usr |
---|
74 | WHERE usr.externalId = :externalId |
---|
75 | </sql> |
---|
76 | <description> |
---|
77 | Load a user when you know the external id. |
---|
78 | </description> |
---|
79 | </query> |
---|
80 | |
---|
81 | <query id="GET_CLIENT_FOR_EXTERNAL_ID" type="HQL"> |
---|
82 | <sql> |
---|
83 | SELECT cli |
---|
84 | FROM ClientData cli |
---|
85 | WHERE cli.externalId = :externalId |
---|
86 | </sql> |
---|
87 | <description> |
---|
88 | Load a client when you know the external ID. |
---|
89 | </description> |
---|
90 | </query> |
---|
91 | |
---|
92 | <query id="GET_ROLE_IDS_FOR_USER" type="HQL"> |
---|
93 | <sql> |
---|
94 | SELECT ur.roleId |
---|
95 | FROM UserRoles ur |
---|
96 | WHERE ur.userId = :userId |
---|
97 | </sql> |
---|
98 | <description> |
---|
99 | Load the ID of all roles where the given user is a member. |
---|
100 | </description> |
---|
101 | </query> |
---|
102 | |
---|
103 | <query id="GET_GROUP_IDS_FOR_USER" type="HQL"> |
---|
104 | <sql> |
---|
105 | SELECT ug.groupId |
---|
106 | FROM UserGroups ug |
---|
107 | WHERE ug.userId = :userId |
---|
108 | </sql> |
---|
109 | <description> |
---|
110 | Load the ID of all groups where the given user is a direct member. |
---|
111 | </description> |
---|
112 | </query> |
---|
113 | |
---|
114 | <query id="GET_PARENTGROUPS_IDS_FOR_GROUPS" type="HQL"> |
---|
115 | <sql> |
---|
116 | SELECT DISTINCT gg.parentId |
---|
117 | FROM GroupGroups gg |
---|
118 | WHERE gg.childId IN (:groups) |
---|
119 | AND gg.parentId NOT IN (:groups) |
---|
120 | </sql> |
---|
121 | <description> |
---|
122 | Load the ID of all groups that are parents to at least one of |
---|
123 | the given groups, excluding the given groups. |
---|
124 | </description> |
---|
125 | </query> |
---|
126 | |
---|
127 | <query id="GET_PROJECT_IDS_FOR_OWNER" type="HQL"> |
---|
128 | <sql> |
---|
129 | SELECT p.id |
---|
130 | FROM ProjectData p |
---|
131 | WHERE p.owner = :userId |
---|
132 | </sql> |
---|
133 | <description> |
---|
134 | Load the ID of all projects where the given user is the owner. |
---|
135 | </description> |
---|
136 | </query> |
---|
137 | |
---|
138 | <query id="GET_PROJECTINFO_FOR_USER" type="HQL"> |
---|
139 | <sql> |
---|
140 | SELECT up |
---|
141 | FROM UserProjects up |
---|
142 | WHERE up.userId = :userId |
---|
143 | </sql> |
---|
144 | <description> |
---|
145 | Load the UserProjects of all projects where the given user is a member. |
---|
146 | </description> |
---|
147 | </query> |
---|
148 | |
---|
149 | <query id="GET_UNIQUE_SCORE_TYPES_IN_HITS_FOR_PROJECT" type="HQL"> |
---|
150 | <sql> |
---|
151 | SELECT DISTINCT h.scoreType |
---|
152 | FROM HitData h |
---|
153 | WHERE h.project = :project |
---|
154 | ORDER by h.scoreType |
---|
155 | </sql> |
---|
156 | <description> |
---|
157 | Load all distinct (unique) score types in the Hits table for a project |
---|
158 | </description> |
---|
159 | </query> |
---|
160 | |
---|
161 | <query id="GET_UNIQUE_PLATEIDS_IN_HITS_FOR_PROJECT" type="HQL"> |
---|
162 | <sql> |
---|
163 | SELECT DISTINCT h.plateId |
---|
164 | FROM HitData h |
---|
165 | WHERE h.project = :project |
---|
166 | ORDER by h.plateId |
---|
167 | </sql> |
---|
168 | <description> |
---|
169 | Load all distinct (unique) plateIds in the Hits table for a project. |
---|
170 | </description> |
---|
171 | </query> |
---|
172 | |
---|
173 | <query id="GET_UNIQUE_GELEXTERNALIDS_IN_HITS_FOR_PROJECT" type="HQL"> |
---|
174 | <sql> |
---|
175 | SELECT DISTINCT h.gelExternalId |
---|
176 | FROM HitData h |
---|
177 | WHERE h.project = :project |
---|
178 | ORDER by h.gelExternalId |
---|
179 | </sql> |
---|
180 | <description> |
---|
181 | Load all distinct (unique) gelIds in the Hits table for a project. |
---|
182 | </description> |
---|
183 | </query> |
---|
184 | |
---|
185 | <query id="GET_UNIQUE_LOCALSAMPLEIDS_IN_HITS_FOR_PROJECT" type="HQL"> |
---|
186 | <sql> |
---|
187 | SELECT DISTINCT h.localSampleId |
---|
188 | FROM HitData h |
---|
189 | WHERE h.project = :project |
---|
190 | ORDER by h.localSampleId |
---|
191 | </sql> |
---|
192 | <description> |
---|
193 | Load all distinct (unique) localSampleIds in the Hits table for a project. |
---|
194 | </description> |
---|
195 | </query> |
---|
196 | |
---|
197 | <query id="GET_UNIQUE_FRACTIONIDS_IN_HITS_FOR_PROJECT" type="HQL"> |
---|
198 | <sql> |
---|
199 | SELECT DISTINCT h.fractionId |
---|
200 | FROM HitData h |
---|
201 | WHERE h.project = :project |
---|
202 | ORDER by h.fractionId |
---|
203 | </sql> |
---|
204 | <description> |
---|
205 | Load all distinct (unique) fractionIds in the Hits table for a project. |
---|
206 | </description> |
---|
207 | </query> |
---|
208 | |
---|
209 | <query id="GET_UNIQUE_REPLICATEIDS_IN_HITS_FOR_PROJECT" type="HQL"> |
---|
210 | <sql> |
---|
211 | SELECT DISTINCT h.replicateId |
---|
212 | FROM HitData h |
---|
213 | WHERE h.project = :project |
---|
214 | ORDER by h.replicateId |
---|
215 | </sql> |
---|
216 | <description> |
---|
217 | Load all distinct (unique) replicateIds in the Hits table for a project. |
---|
218 | </description> |
---|
219 | </query> |
---|
220 | |
---|
221 | <query id="GET_UNIQUE_REPLICATEIDS_IN_HITS_FOR_LOCALSAMPLEID_IN_PROJECT" type="HQL"> |
---|
222 | <sql> |
---|
223 | SELECT DISTINCT h.replicateId |
---|
224 | FROM HitData h |
---|
225 | WHERE h.project = :project AND h.localSampleId = :localSampleId |
---|
226 | ORDER by h.replicateId |
---|
227 | </sql> |
---|
228 | <description> |
---|
229 | Load all distinct (unique) replicateIds for a sampleLocalId in the Hits table for a project. |
---|
230 | </description> |
---|
231 | </query> |
---|
232 | |
---|
233 | <query id="GET_UNIQUE_PEPTIDE_SEQUENCES_IN_HITS_FOR_PROJECT" type="HQL"> |
---|
234 | <sql> |
---|
235 | SELECT DISTINCT h.description |
---|
236 | FROM HitData h |
---|
237 | WHERE h.project = :project AND h.protein = false |
---|
238 | ORDER by h.description |
---|
239 | </sql> |
---|
240 | <description> |
---|
241 | Load all distinct (unique) peptide sequences in the Hits table for a project. |
---|
242 | </description> |
---|
243 | </query> |
---|
244 | |
---|
245 | <query id="GET_UNIQUE_CHARGES_IN_HITS_FOR_PROJECT" type="HQL"> |
---|
246 | <sql> |
---|
247 | SELECT DISTINCT h.charge |
---|
248 | FROM HitData h |
---|
249 | WHERE h.project = :project |
---|
250 | ORDER by h.charge |
---|
251 | </sql> |
---|
252 | <description> |
---|
253 | Load all distinct (unique) charges in the Hits table for a project. |
---|
254 | </description> |
---|
255 | </query> |
---|
256 | |
---|
257 | <query id="GET_UNIQUE_EXTERNALIDS_IN_HITS_FOR_PROJECT" type="HQL"> |
---|
258 | <sql> |
---|
259 | SELECT DISTINCT h.externalId |
---|
260 | FROM HitData h |
---|
261 | WHERE h.project = :project |
---|
262 | ORDER by h.externalId |
---|
263 | </sql> |
---|
264 | <description> |
---|
265 | Load all distinct (unique) external Ids in the Hits table for a project. |
---|
266 | </description> |
---|
267 | </query> |
---|
268 | |
---|
269 | <query id="GET_UNIQUE_IDENTIFICATIONRESULTFILES_IN_HITS_FOR_PROJECT" type="HQL"> |
---|
270 | <sql> |
---|
271 | SELECT DISTINCT h.identificationResultFile |
---|
272 | FROM HitData h |
---|
273 | WHERE h.project = :project |
---|
274 | ORDER by h.identificationResultFile |
---|
275 | </sql> |
---|
276 | <description> |
---|
277 | Load all distinct (unique) identification result file Ids in the Hits table for a project. |
---|
278 | </description> |
---|
279 | </query> |
---|
280 | |
---|
281 | <query id="GET_UNIQUE_PEAKLISTFILES_IN_HITS_FOR_PROJECT" type="HQL"> |
---|
282 | <sql> |
---|
283 | SELECT DISTINCT h.peakListFile |
---|
284 | FROM HitData h |
---|
285 | WHERE h.project = :project |
---|
286 | ORDER by h.peakListFile |
---|
287 | </sql> |
---|
288 | <description> |
---|
289 | Load all distinct (unique) peakList file Ids in the Hits table for a project. |
---|
290 | </description> |
---|
291 | </query> |
---|
292 | |
---|
293 | <query id="GET_UNIQUE_PEAKLISTFILES_IN_HITS_FOR_IDENTIFICATIONRESULTFILE_IN_PROJECT" type="HQL"> |
---|
294 | <sql> |
---|
295 | SELECT DISTINCT h.peakListFile |
---|
296 | FROM HitData h |
---|
297 | WHERE h.project = :project AND h.identificationResultFile = :identificationResultFile |
---|
298 | ORDER by h.peakListFile |
---|
299 | </sql> |
---|
300 | <description> |
---|
301 | Load all distinct (unique) peakList file Ids for an identification result file in the Hits table for a project. |
---|
302 | </description> |
---|
303 | </query> |
---|
304 | |
---|
305 | <query id="GET_UNIQUE_IDENTIFICATIONRESULTFILES_IN_HITS_FOR_PEAKLISTFILE_IN_PROJECT" type="HQL"> |
---|
306 | <sql> |
---|
307 | SELECT DISTINCT h.identificationResultFile |
---|
308 | FROM HitData h |
---|
309 | WHERE h.project = :project AND h.peakListFile = :peakListFile |
---|
310 | ORDER by h.identificationResultFile |
---|
311 | </sql> |
---|
312 | <description> |
---|
313 | Load all distinct (unique) identification result file Ids for a peakList file in the Hits table for a project. |
---|
314 | </description> |
---|
315 | </query> |
---|
316 | |
---|
317 | <query id="GET_HIT_FOR_FEATURE_MSFILE_FOR_PROJECT" type="HQL"> |
---|
318 | <sql> |
---|
319 | SELECT h |
---|
320 | FROM HitData h |
---|
321 | WHERE h.feature.msFile = :msFile AND h.project = :project |
---|
322 | </sql> |
---|
323 | <description> |
---|
324 | Load all hits which have features with the given msFile in the Feature table for a project |
---|
325 | </description> |
---|
326 | </query> |
---|
327 | |
---|
328 | <query id="GET_UNIQUE_MSFILES_IN_FEATURES_FOR_PROJECT" type="HQL"> |
---|
329 | <sql> |
---|
330 | SELECT DISTINCT h.msFile |
---|
331 | FROM FeatureData h |
---|
332 | WHERE h.project = :project |
---|
333 | </sql> |
---|
334 | <description> |
---|
335 | Load all distinct (unique) ms files in the Feature table for a project |
---|
336 | </description> |
---|
337 | </query> |
---|
338 | |
---|
339 | <query id="GET_UNIQUE_FEATUREFILES_IN_FEATURES_FOR_PROJECT" type="HQL"> |
---|
340 | <sql> |
---|
341 | SELECT DISTINCT h.featureFile |
---|
342 | FROM FeatureData h |
---|
343 | WHERE h.project = :project |
---|
344 | ORDER by h.featureFile |
---|
345 | </sql> |
---|
346 | <description> |
---|
347 | Load all distinct (unique) feature files in the Feature table for a project |
---|
348 | </description> |
---|
349 | </query> |
---|
350 | |
---|
351 | <query id="GET_UNIQUE_MSFILES_IN_FEATURES_FOR_FEATUREFILE_IN_PROJECT" type="HQL"> |
---|
352 | <sql> |
---|
353 | SELECT DISTINCT h.msFile |
---|
354 | FROM FeatureData h |
---|
355 | WHERE h.project = :project AND h.featureFile = :featureFile |
---|
356 | </sql> |
---|
357 | <description> |
---|
358 | Load all distinct (unique) ms files for a feature file in the Feature table for a project |
---|
359 | </description> |
---|
360 | </query> |
---|
361 | |
---|
362 | <query id="GET_UNIQUE_FEATUREFILES_IN_FEATURES_FOR_MSFILE_IN_PROJECT" type="HQL"> |
---|
363 | <sql> |
---|
364 | SELECT DISTINCT h.featureFile |
---|
365 | FROM FeatureData h |
---|
366 | WHERE h.project = :project AND h.msFile = :msFile |
---|
367 | </sql> |
---|
368 | <description> |
---|
369 | Load all distinct (unique) feature files for an ms file in the Feature table for a project |
---|
370 | </description> |
---|
371 | </query> |
---|
372 | |
---|
373 | <query id="DELETE_FEATURES_FOR_MSFILE_IN_PROJECT" type="HQL"> |
---|
374 | <sql> |
---|
375 | DELETE FeatureData f |
---|
376 | WHERE f.project = :project AND f.msFile = :msFile |
---|
377 | </sql> |
---|
378 | <description> |
---|
379 | Delete all features for an ms file in the Feature table for a project |
---|
380 | </description> |
---|
381 | </query> |
---|
382 | |
---|
383 | <query id="GET_IDS_FOR_SEPARATION_METHODS_WITH_SEPARATION_EVENTS" type="HQL"> |
---|
384 | <sql> |
---|
385 | SELECT separationMethod.id |
---|
386 | FROM SeparationEventData bme |
---|
387 | WHERE NOT bme.separationMethod IS NULL |
---|
388 | </sql> |
---|
389 | <description> |
---|
390 | Load all separationMethod ids for separation methods with associated seapration events. |
---|
391 | </description> |
---|
392 | </query> |
---|
393 | |
---|
394 | <query id="GET_SEPARATIONMETHOD_FOR_EXTERNAL_ID" type="HQL"> |
---|
395 | <sql> |
---|
396 | SELECT sm |
---|
397 | FROM SeparationMethodData sm |
---|
398 | WHERE sm.externalId = :externalId |
---|
399 | </sql> |
---|
400 | <description> |
---|
401 | Load Separationmethod by the given externalId. |
---|
402 | </description> |
---|
403 | </query> |
---|
404 | |
---|
405 | <query id="GET_PROJECTINFO_FOR_GROUPS" type="HQL"> |
---|
406 | <sql> |
---|
407 | SELECT DISTINCT gp |
---|
408 | FROM GroupProjects gp |
---|
409 | WHERE gp.groupId IN (:groups) |
---|
410 | </sql> |
---|
411 | <description> |
---|
412 | Load the GroupProjects of all projects where at least one of the given groups |
---|
413 | is a member. |
---|
414 | </description> |
---|
415 | </query> |
---|
416 | |
---|
417 | <query id="GET_USER_IDS_FOR_GROUPS" type="HQL"> |
---|
418 | <sql> |
---|
419 | SELECT ug.userId |
---|
420 | FROM UserGroups ug |
---|
421 | WHERE ug.groupId IN (:groups) |
---|
422 | </sql> |
---|
423 | <description> |
---|
424 | Load the ID of all users which is a member of at least one of the given groups. |
---|
425 | </description> |
---|
426 | </query> |
---|
427 | |
---|
428 | <query id="GET_USERKEYS_FOR_USER" type="HQL"> |
---|
429 | <sql> |
---|
430 | SELECT uk |
---|
431 | FROM UserKeys uk |
---|
432 | WHERE uk.userId = :userId |
---|
433 | </sql> |
---|
434 | <description> |
---|
435 | Load the UserKeys for the given user. |
---|
436 | </description> |
---|
437 | </query> |
---|
438 | |
---|
439 | <query id="GET_GROUPKEYS_FOR_GROUPS" type="HQL"> |
---|
440 | <sql> |
---|
441 | SELECT gk |
---|
442 | FROM GroupKeys gk |
---|
443 | WHERE gk.groupId IN (:groups) |
---|
444 | </sql> |
---|
445 | <description> |
---|
446 | Load the GroupKeys for the given groups. |
---|
447 | </description> |
---|
448 | </query> |
---|
449 | |
---|
450 | <query id="GET_ROLEKEYS_FOR_USER" type="HQL"> |
---|
451 | <sql> |
---|
452 | SELECT rk |
---|
453 | FROM RoleKeys rk, UserRoles ur |
---|
454 | WHERE rk.roleId = ur.roleId AND ur.userId = :userId |
---|
455 | ORDER BY rk.keyId |
---|
456 | </sql> |
---|
457 | <description> |
---|
458 | Load the RoleKeys for the roles where the given user is a member. |
---|
459 | </description> |
---|
460 | </query> |
---|
461 | |
---|
462 | <query id="GET_PROJECTKEYS_FOR_PROJECT" type="HQL"> |
---|
463 | <sql> |
---|
464 | SELECT pk |
---|
465 | FROM ProjectKeys pk |
---|
466 | WHERE pk.projectId = :projectId |
---|
467 | ORDER BY pk.keyId |
---|
468 | </sql> |
---|
469 | <description> |
---|
470 | Load the ProjectKeys for the given project. |
---|
471 | </description> |
---|
472 | </query> |
---|
473 | |
---|
474 | <query id="GET_PERMISSION_FOR_USER_IN_PROJECT" type="HQL"> |
---|
475 | <sql> |
---|
476 | SELECT up.permission |
---|
477 | FROM UserProjects up |
---|
478 | WHERE up.userId = :userId |
---|
479 | AND up.projectId = :projectId |
---|
480 | </sql> |
---|
481 | <description> |
---|
482 | Load the permission for the given user in the given project. |
---|
483 | </description> |
---|
484 | </query> |
---|
485 | |
---|
486 | <query id="GET_PERMISSIONS_FOR_GROUPS_IN_PROJECT" type="HQL"> |
---|
487 | <sql> |
---|
488 | SELECT gp.permission |
---|
489 | FROM GroupProjects gp |
---|
490 | WHERE gp.groupId IN (:groups) |
---|
491 | AND gp.projectId = :projectId |
---|
492 | </sql> |
---|
493 | <description> |
---|
494 | Load the permissions for the given groups in the given project. |
---|
495 | </description> |
---|
496 | </query> |
---|
497 | |
---|
498 | <query id="GET_PROJECTKEY_IDS_FOR_COUNT" type="HQL"> |
---|
499 | <sql> |
---|
500 | SELECT pk.keyId FROM ProjectKeys pk |
---|
501 | GROUP BY pk.keyId |
---|
502 | HAVING count(pk.projectId) = :numPermissions |
---|
503 | </sql> |
---|
504 | <description> |
---|
505 | Load the ID of all project keys which have permissions for the |
---|
506 | specified number of projects. |
---|
507 | </description> |
---|
508 | </query> |
---|
509 | |
---|
510 | <query id="FIND_USED_PROJECTKEY_IDS" type="HQL"> |
---|
511 | <sql> |
---|
512 | SELECT DISTINCT sd.projectKey.id |
---|
513 | FROM org.proteios.core.data.ShareableData sd |
---|
514 | WHERE NOT sd.projectKey IS NULL |
---|
515 | </sql> |
---|
516 | <description> |
---|
517 | Load the ID of all project keys which are used by at least one |
---|
518 | shareable item. |
---|
519 | </description> |
---|
520 | </query> |
---|
521 | |
---|
522 | <query id="SELECT_UNUSED_PROJECTKEYS" type="HQL"> |
---|
523 | <sql> |
---|
524 | SELECT pk FROM ProjectKeyData pk |
---|
525 | WHERE pk.id NOT IN (:used) |
---|
526 | </sql> |
---|
527 | <description> |
---|
528 | Load all unused project keys given a list of the ID:s of all used |
---|
529 | keys. |
---|
530 | </description> |
---|
531 | </query> |
---|
532 | |
---|
533 | <query id="GET_ITEMKEY_IDS_FOR_USERCOUNT" type="HQL"> |
---|
534 | <sql> |
---|
535 | SELECT ik.id FROM ItemKeyData ik |
---|
536 | LEFT JOIN ik.users u |
---|
537 | GROUP BY ik.id |
---|
538 | HAVING COUNT(u.index) = :numPermissions |
---|
539 | </sql> |
---|
540 | <description> |
---|
541 | Load the ID of all item keys which have permissions for the |
---|
542 | specified number of users. |
---|
543 | </description> |
---|
544 | </query> |
---|
545 | |
---|
546 | <query id="GET_ITEMKEY_IDS_FOR_GROUPCOUNT" type="HQL"> |
---|
547 | <sql> |
---|
548 | SELECT ik.id FROM ItemKeyData ik |
---|
549 | LEFT JOIN ik.groups g |
---|
550 | WHERE ik.id IN (:candidates) |
---|
551 | GROUP BY ik.id |
---|
552 | HAVING count(g.index) = :numPermissions |
---|
553 | </sql> |
---|
554 | <description> |
---|
555 | Load the ID of all item keys which have permissions for the |
---|
556 | specified number of groups and are among the list of candidates. |
---|
557 | </description> |
---|
558 | </query> |
---|
559 | |
---|
560 | <query id="FIND_USED_ITEMKEY_IDS" type="HQL"> |
---|
561 | <sql> |
---|
562 | SELECT DISTINCT sd.itemKey.id |
---|
563 | FROM org.proteios.core.data.ShareableData sd |
---|
564 | WHERE NOT sd.itemKey IS NULL |
---|
565 | </sql> |
---|
566 | <description> |
---|
567 | Load the ID of all item keys which are used by at least one |
---|
568 | shareable item. |
---|
569 | </description> |
---|
570 | </query> |
---|
571 | |
---|
572 | <query id="SELECT_UNUSED_ITEMKEYS" type="HQL"> |
---|
573 | <sql> |
---|
574 | SELECT ik FROM ItemKeyData ik |
---|
575 | WHERE ik.id NOT IN (:used) |
---|
576 | </sql> |
---|
577 | <description> |
---|
578 | Load all unused item keys given a list of the ID:s of all used |
---|
579 | keys. |
---|
580 | </description> |
---|
581 | </query> |
---|
582 | |
---|
583 | <query id="COUNT_USERS_FOR_QUOTAGROUP" type="HQL"> |
---|
584 | <sql> |
---|
585 | SELECT count(*) |
---|
586 | FROM UserData usr |
---|
587 | WHERE usr.quotaGroup = :theGroup |
---|
588 | </sql> |
---|
589 | <description> |
---|
590 | Count the number of users having the specified group as |
---|
591 | their quota group. |
---|
592 | </description> |
---|
593 | </query> |
---|
594 | |
---|
595 | <query id="COUNT_USERS_FOR_QUOTA" type="HQL"> |
---|
596 | <sql> |
---|
597 | SELECT count(*) |
---|
598 | FROM UserData u |
---|
599 | WHERE u.quota = :quota |
---|
600 | </sql> |
---|
601 | <description> |
---|
602 | A Hibernate query that counts the number of users |
---|
603 | that has been assigned a given quota. |
---|
604 | </description> |
---|
605 | </query> |
---|
606 | |
---|
607 | <query id="COUNT_GROUPS_FOR_QUOTA" type="HQL"> |
---|
608 | <sql> |
---|
609 | SELECT count(*) |
---|
610 | FROM GroupData g |
---|
611 | WHERE g.quota = :quota |
---|
612 | </sql> |
---|
613 | <description> |
---|
614 | A Hibernate query that counts the number of groups |
---|
615 | that has been assigned a given quota. |
---|
616 | </description> |
---|
617 | </query> |
---|
618 | |
---|
619 | <query id="GET_SHAREABLE_ITEMS_FOR_ITEMKEY" type="HQL"> |
---|
620 | <sql> |
---|
621 | SELECT s |
---|
622 | FROM org.proteios.core.data.ShareableData s |
---|
623 | WHERE s.itemKey = :itemKey |
---|
624 | </sql> |
---|
625 | <description> |
---|
626 | Get all items beeing shared to the specified item key. |
---|
627 | </description> |
---|
628 | </query> |
---|
629 | |
---|
630 | <query id="GET_SHAREABLE_ITEMS_FOR_PROJECTKEY" type="HQL"> |
---|
631 | <sql> |
---|
632 | SELECT s |
---|
633 | FROM org.proteios.core.data.ShareableData s |
---|
634 | WHERE s.projectKey = :projectKey |
---|
635 | </sql> |
---|
636 | <description> |
---|
637 | Get all items beeing shared to the specified project key. |
---|
638 | </description> |
---|
639 | </query> |
---|
640 | |
---|
641 | <query id="GET_OWNABLE_ITEMS_FOR_USER" type="HQL"> |
---|
642 | <sql> |
---|
643 | SELECT o |
---|
644 | FROM org.proteios.core.data.OwnableData o |
---|
645 | WHERE o.owner = :user |
---|
646 | </sql> |
---|
647 | <description> |
---|
648 | Get all items that are owned by the specified user. |
---|
649 | </description> |
---|
650 | </query> |
---|
651 | |
---|
652 | <query id="LOAD_USER_CLIENT_SETTINGS" type="HQL"> |
---|
653 | <sql> |
---|
654 | SELECT s |
---|
655 | FROM UserClientSettingData s |
---|
656 | WHERE s.user = :user AND s.client = :client |
---|
657 | </sql> |
---|
658 | <description> |
---|
659 | Load all settings for the specified user and client application. |
---|
660 | </description> |
---|
661 | </query> |
---|
662 | |
---|
663 | <query id="LOAD_USER_DEFAULT_SETTINGS" type="HQL"> |
---|
664 | <sql> |
---|
665 | SELECT s |
---|
666 | FROM UserDefaultSettingData s |
---|
667 | WHERE s.user = :user |
---|
668 | </sql> |
---|
669 | <description> |
---|
670 | Load all default settings for the specified user. |
---|
671 | </description> |
---|
672 | </query> |
---|
673 | |
---|
674 | <query id="LOAD_CLIENT_DEFAULT_SETTINGS" type="HQL"> |
---|
675 | <sql> |
---|
676 | SELECT s |
---|
677 | FROM ClientDefaultSettingData s |
---|
678 | WHERE s.client = :client |
---|
679 | </sql> |
---|
680 | <description> |
---|
681 | Load all default settings for the specified client application. |
---|
682 | </description> |
---|
683 | </query> |
---|
684 | |
---|
685 | <query id="GET_MIME_TYPE_FROM_EXTENSION" type="HQL"> |
---|
686 | <sql> |
---|
687 | SELECT s |
---|
688 | FROM org.proteios.core.data.MimeTypeData s |
---|
689 | WHERE s.extension = :extension |
---|
690 | </sql> |
---|
691 | <description> |
---|
692 | A Hibernate query that returns a MimeType given an extension. |
---|
693 | </description> |
---|
694 | </query> |
---|
695 | |
---|
696 | <query id="GET_MIME_TYPE_DATA_LIST" type="HQL"> |
---|
697 | <sql> |
---|
698 | SELECT mt |
---|
699 | FROM MimeTypeData mt |
---|
700 | </sql> |
---|
701 | <description> |
---|
702 | A Hibernate query that returns a list of available MimeTypeData. |
---|
703 | </description> |
---|
704 | </query> |
---|
705 | |
---|
706 | <query id="GET_TOTAL_DISKUSAGE_FOR_USER" type="HQL"> |
---|
707 | <sql> |
---|
708 | SELECT sum(du.bytes) |
---|
709 | FROM DiskUsageData du |
---|
710 | WHERE du.user = :user |
---|
711 | AND du.location = :location |
---|
712 | </sql> |
---|
713 | <description> |
---|
714 | A Hibernate query that returns the total used quota |
---|
715 | for the specified user at the specified location. |
---|
716 | </description> |
---|
717 | </query> |
---|
718 | |
---|
719 | <query id="GET_SPECIFIC_DISKUSAGE_FOR_USER" type="HQL"> |
---|
720 | <sql> |
---|
721 | SELECT sum(du.bytes) |
---|
722 | FROM DiskUsageData du |
---|
723 | WHERE du.user = :user |
---|
724 | AND du.location = :location |
---|
725 | AND du.quotaType = :quotaType |
---|
726 | </sql> |
---|
727 | <description> |
---|
728 | A Hibernate query that returns the used quota for the |
---|
729 | specific quota type for the specified user at the |
---|
730 | specified location. |
---|
731 | </description> |
---|
732 | </query> |
---|
733 | |
---|
734 | <query id="GET_TOTAL_DISKUSAGE_FOR_GROUP" type="HQL"> |
---|
735 | <sql> |
---|
736 | SELECT sum(du.bytes) |
---|
737 | FROM DiskUsageData du |
---|
738 | WHERE du.group = :group |
---|
739 | AND du.location = :location |
---|
740 | </sql> |
---|
741 | <description> |
---|
742 | A Hibernate query that returns the total used quota |
---|
743 | for the specified group at the specified location. |
---|
744 | </description> |
---|
745 | </query> |
---|
746 | |
---|
747 | <query id="GET_SPECIFIC_DISKUSAGE_FOR_GROUP" type="HQL"> |
---|
748 | <sql> |
---|
749 | SELECT sum(du.bytes) |
---|
750 | FROM DiskUsageData du |
---|
751 | WHERE du.group = :group |
---|
752 | AND du.location = :location |
---|
753 | AND du.quotaType = :quotaType |
---|
754 | </sql> |
---|
755 | <description> |
---|
756 | A Hibernate query that returns the used quota for the |
---|
757 | specific quota type for the specified group at the |
---|
758 | specified location. |
---|
759 | </description> |
---|
760 | </query> |
---|
761 | |
---|
762 | <query id="COUNT_FILES_IN_DIRECTORY" type="HQL"> |
---|
763 | <sql> |
---|
764 | SELECT count(*) |
---|
765 | FROM FileData f |
---|
766 | WHERE f.directory = :directory |
---|
767 | </sql> |
---|
768 | <description> |
---|
769 | A Hibernate query that counts the number of files |
---|
770 | in a given directory. |
---|
771 | </description> |
---|
772 | </query> |
---|
773 | |
---|
774 | <query id="COUNT_FILES_FOR_FILETYPE" type="HQL"> |
---|
775 | <sql> |
---|
776 | SELECT count(*) |
---|
777 | FROM FileData f |
---|
778 | WHERE f.fileType = :filetype |
---|
779 | </sql> |
---|
780 | <description> |
---|
781 | A Hibernate query that counts the number of files |
---|
782 | with a given filetype. |
---|
783 | </description> |
---|
784 | </query> |
---|
785 | |
---|
786 | <query id="COUNT_SUBDIRECTORIES_IN_DIRECTORY" type="HQL"> |
---|
787 | <sql> |
---|
788 | SELECT count(*) |
---|
789 | FROM DirectoryData d |
---|
790 | WHERE d.parent = :directory |
---|
791 | </sql> |
---|
792 | <description> |
---|
793 | A Hibernate query that counts the number of subdirectories |
---|
794 | in a given directory. |
---|
795 | </description> |
---|
796 | </query> |
---|
797 | |
---|
798 | <query id="COUNT_HOME_DIRECTORIES" type="HQL"> |
---|
799 | <sql> |
---|
800 | SELECT COUNT(*) |
---|
801 | FROM UserData usr |
---|
802 | WHERE usr.homeDirectory = :directory |
---|
803 | </sql> |
---|
804 | <description> |
---|
805 | A Hibernate query that counts the number of users having |
---|
806 | the specified directory as home directory. |
---|
807 | </description> |
---|
808 | </query> |
---|
809 | |
---|
810 | <query id="IS_PROJECT_DIRECTORY" type="HQL"> |
---|
811 | <sql> |
---|
812 | SELECT count(*) |
---|
813 | FROM ProjectData d |
---|
814 | WHERE d.projectDirectory = :directory |
---|
815 | </sql> |
---|
816 | <description> |
---|
817 | A Hibernate query that checks if the given directory is |
---|
818 | connected to any project as it's main directory. |
---|
819 | </description> |
---|
820 | </query> |
---|
821 | |
---|
822 | <query id="GET_SUBDIRECTORIES" type="HQL"> |
---|
823 | <sql> |
---|
824 | SELECT dir |
---|
825 | FROM DirectoryData dir |
---|
826 | WHERE dir.parent = :parent |
---|
827 | </sql> |
---|
828 | <description> |
---|
829 | A Hibernate query that returns all subdirectories in a directory. |
---|
830 | </description> |
---|
831 | </query> |
---|
832 | |
---|
833 | <query id="GET_SUBDIRECTORY_WITH_NAME" type="HQL"> |
---|
834 | <sql> |
---|
835 | SELECT dir |
---|
836 | FROM DirectoryData dir |
---|
837 | WHERE dir.name = :name |
---|
838 | AND dir.parent = :parent |
---|
839 | </sql> |
---|
840 | <description> |
---|
841 | A Hibernate query that returns the a subdirectory with the |
---|
842 | specified name in a given directory. |
---|
843 | </description> |
---|
844 | </query> |
---|
845 | |
---|
846 | <query id="GET_FILE_TYPE_WITH_NAME" type="HQL"> |
---|
847 | <sql> |
---|
848 | SELECT ft |
---|
849 | FROM FileTypeData ft |
---|
850 | WHERE ft.name = :name |
---|
851 | </sql> |
---|
852 | <description> |
---|
853 | A Hibernate query that returns the file type with the specified |
---|
854 | name. |
---|
855 | </description> |
---|
856 | </query> |
---|
857 | |
---|
858 | <query id="GET_QUOTA_TYPE_WITH_NAME" type="HQL"> |
---|
859 | <sql> |
---|
860 | SELECT qt |
---|
861 | FROM QuotaTypeData qt |
---|
862 | WHERE qt.name = :name |
---|
863 | </sql> |
---|
864 | <description> |
---|
865 | A Hibernate query that returns the quota type with the specified |
---|
866 | name. |
---|
867 | </description> |
---|
868 | </query> |
---|
869 | |
---|
870 | <query id="GET_QUOTA_WITH_NAME" type="HQL"> |
---|
871 | <sql> |
---|
872 | SELECT q |
---|
873 | FROM QuotaData q |
---|
874 | WHERE q.name = :name |
---|
875 | </sql> |
---|
876 | <description> |
---|
877 | A Hibernate query that returns the quota with the specified |
---|
878 | name. |
---|
879 | </description> |
---|
880 | </query> |
---|
881 | |
---|
882 | <query id="GET_GROUP_WITH_NAME" type="HQL"> |
---|
883 | <sql> |
---|
884 | SELECT grp |
---|
885 | FROM GroupData grp |
---|
886 | WHERE grp.name = :name |
---|
887 | </sql> |
---|
888 | <description> |
---|
889 | A Hibernate query that returns the group with the specified |
---|
890 | name. |
---|
891 | </description> |
---|
892 | </query> |
---|
893 | |
---|
894 | <query id="GET_ROLE_WITH_NAME" type="HQL"> |
---|
895 | <sql> |
---|
896 | SELECT rle |
---|
897 | FROM RoleData rle |
---|
898 | WHERE rle.name = :name |
---|
899 | </sql> |
---|
900 | <description> |
---|
901 | A Hibernate query that returns the role with the specified |
---|
902 | name. |
---|
903 | </description> |
---|
904 | </query> |
---|
905 | |
---|
906 | <query id="GET_PROTOCOL_TYPE_WITH_NAME" type="HQL"> |
---|
907 | <sql> |
---|
908 | SELECT pt |
---|
909 | FROM ProtocolTypeData pt |
---|
910 | WHERE pt.name = :name |
---|
911 | </sql> |
---|
912 | <description> |
---|
913 | A Hibernate query that returns the protocol type with the specified |
---|
914 | name. |
---|
915 | </description> |
---|
916 | </query> |
---|
917 | |
---|
918 | <query id="GET_SOFTWARE_TYPE_WITH_NAME" type="HQL"> |
---|
919 | <sql> |
---|
920 | SELECT st |
---|
921 | FROM SoftwareTypeData st |
---|
922 | WHERE st.name = :name |
---|
923 | </sql> |
---|
924 | <description> |
---|
925 | A Hibernate query that returns the software type with the specified |
---|
926 | name. |
---|
927 | </description> |
---|
928 | </query> |
---|
929 | |
---|
930 | <query id="GET_SOFTWARE_WITH_NAME" type="HQL"> |
---|
931 | <sql> |
---|
932 | SELECT sw |
---|
933 | FROM SoftwareData sw |
---|
934 | WHERE sw.name = :name |
---|
935 | </sql> |
---|
936 | <description> |
---|
937 | A Hibernate query that returns the software with the specified |
---|
938 | name. |
---|
939 | </description> |
---|
940 | </query> |
---|
941 | |
---|
942 | <query id="GET_HARDWARE_TYPE_WITH_NAME" type="HQL"> |
---|
943 | <sql> |
---|
944 | SELECT ht |
---|
945 | FROM HardwareTypeData ht |
---|
946 | WHERE ht.name = :name |
---|
947 | </sql> |
---|
948 | <description> |
---|
949 | A Hibernate query that returns the hardware type with the specified |
---|
950 | name. |
---|
951 | </description> |
---|
952 | </query> |
---|
953 | |
---|
954 | <query id="GET_HARDWARE_WITH_NAME" type="HQL"> |
---|
955 | <sql> |
---|
956 | SELECT hw |
---|
957 | FROM HardwareData hw |
---|
958 | WHERE hw.name = :name |
---|
959 | </sql> |
---|
960 | <description> |
---|
961 | A Hibernate query that returns the hardware with the specified |
---|
962 | name. |
---|
963 | </description> |
---|
964 | </query> |
---|
965 | |
---|
966 | <query id="GET_LABEL_WITH_NAME" type="HQL"> |
---|
967 | <sql> |
---|
968 | SELECT lbl |
---|
969 | FROM LabelData lbl |
---|
970 | WHERE lbl.name = :name |
---|
971 | </sql> |
---|
972 | <description> |
---|
973 | A Hibernate query that returns the label with the specified |
---|
974 | name. |
---|
975 | </description> |
---|
976 | </query> |
---|
977 | |
---|
978 | <query id="GET_ANNOTATION_TYPE_WITH_NAME" type="HQL"> |
---|
979 | <sql> |
---|
980 | SELECT at |
---|
981 | FROM AnnotationTypeData at |
---|
982 | WHERE at.name = :name |
---|
983 | </sql> |
---|
984 | <description> |
---|
985 | A Hibernate query that returns the annotation type with the specified |
---|
986 | name. |
---|
987 | </description> |
---|
988 | </query> |
---|
989 | |
---|
990 | <query id="GET_NEWS_WITH_NAME" type="HQL"> |
---|
991 | <sql> |
---|
992 | SELECT nws |
---|
993 | FROM NewsData nws |
---|
994 | WHERE nws.name = :name |
---|
995 | </sql> |
---|
996 | <description> |
---|
997 | A Hibernate query that returns the news with the specified |
---|
998 | name. |
---|
999 | </description> |
---|
1000 | </query> |
---|
1001 | |
---|
1002 | <query id="GET_FILE_IN_DIRECTORY" type="HQL"> |
---|
1003 | <sql> |
---|
1004 | SELECT f |
---|
1005 | FROM FileData f |
---|
1006 | WHERE f.directory = :directory |
---|
1007 | AND f.name = :name |
---|
1008 | </sql> |
---|
1009 | <description> |
---|
1010 | A Hibernate query that returns the file with the specified |
---|
1011 | name in a given directory. |
---|
1012 | </description> |
---|
1013 | </query> |
---|
1014 | |
---|
1015 | <query id="COUNT_PROTOCOLS_FOR_PROTOCOLTYPE" type="HQL"> |
---|
1016 | <sql> |
---|
1017 | SELECT count(*) |
---|
1018 | FROM ProtocolData p |
---|
1019 | WHERE p.protocolType = :protocolType |
---|
1020 | </sql> |
---|
1021 | <description> |
---|
1022 | Counts the protocols the uses a protocol type. |
---|
1023 | </description> |
---|
1024 | </query> |
---|
1025 | |
---|
1026 | <query id="COUNT_BIOMATERIALEVENTS_FOR_PROTOCOL" type="HQL"> |
---|
1027 | <sql> |
---|
1028 | SELECT count(*) |
---|
1029 | FROM BioMaterialEventData bme |
---|
1030 | WHERE bme.protocol = :protocol |
---|
1031 | </sql> |
---|
1032 | <description> |
---|
1033 | A Hibernate query that counts the number of biomaterial |
---|
1034 | events using a protocol. |
---|
1035 | </description> |
---|
1036 | </query> |
---|
1037 | |
---|
1038 | <query id="FIND_USED_FILES" type="HQL"> |
---|
1039 | <sql> |
---|
1040 | SELECT fad |
---|
1041 | FROM org.proteios.core.data.FileAttachableData fad |
---|
1042 | WHERE fad.file = :file |
---|
1043 | </sql> |
---|
1044 | <description> |
---|
1045 | Load the files that is used by any FileAttachableData. |
---|
1046 | </description> |
---|
1047 | </query> |
---|
1048 | |
---|
1049 | <query id="COUNT_HARDWARE_FOR_TYPE" type="HQL"> |
---|
1050 | <sql> |
---|
1051 | SELECT count(*) |
---|
1052 | FROM HardwareData hw |
---|
1053 | WHERE hw.hardwareType = :hardwaretype |
---|
1054 | </sql> |
---|
1055 | <description> |
---|
1056 | A Hibernate query that counts the number of hardware items |
---|
1057 | of the given hardware type. |
---|
1058 | </description> |
---|
1059 | </query> |
---|
1060 | |
---|
1061 | <query id="COUNT_SOFTWARE_FOR_SOFTWARETYPE" type="HQL"> |
---|
1062 | <sql> |
---|
1063 | SELECT count(*) |
---|
1064 | FROM SoftwareData sw |
---|
1065 | WHERE sw.softwareType = :softwaretype |
---|
1066 | </sql> |
---|
1067 | <description> |
---|
1068 | A Hibernate query that counts the number of software items |
---|
1069 | of the given software type. |
---|
1070 | </description> |
---|
1071 | </query> |
---|
1072 | |
---|
1073 | <query id="COUNT_ANNOTATIONS_FOR_ANNOTATIONTYPE" type="HQL"> |
---|
1074 | <sql> |
---|
1075 | SELECT count(*) |
---|
1076 | FROM AnnotationData a |
---|
1077 | WHERE a.annotationType = :annotationType |
---|
1078 | </sql> |
---|
1079 | <description> |
---|
1080 | A Hibernate query that counts the number of annotations |
---|
1081 | of the given annotation type. |
---|
1082 | </description> |
---|
1083 | </query> |
---|
1084 | |
---|
1085 | <query id="COUNT_SAMPLES_FOR_BIOSOURCE" type="HQL"> |
---|
1086 | <sql> |
---|
1087 | SELECT count(*) |
---|
1088 | FROM SampleData s |
---|
1089 | WHERE s.parent = :biosource |
---|
1090 | </sql> |
---|
1091 | <description> |
---|
1092 | A Hibernate query that counts the number of samples |
---|
1093 | created from a given biosource. |
---|
1094 | </description> |
---|
1095 | </query> |
---|
1096 | |
---|
1097 | <query id="COUNT_EXTRACTS_FOR_SAMPLE" type="HQL"> |
---|
1098 | <sql> |
---|
1099 | SELECT count(*) |
---|
1100 | FROM ExtractData e |
---|
1101 | WHERE e.parent = :sample |
---|
1102 | </sql> |
---|
1103 | <description> |
---|
1104 | A Hibernate query that counts the number of extracts |
---|
1105 | created from a given sample. |
---|
1106 | </description> |
---|
1107 | </query> |
---|
1108 | |
---|
1109 | <query id="COUNT_LABELED_EXTRACTS_FOR_EXTRACT" type="HQL"> |
---|
1110 | <sql> |
---|
1111 | SELECT count(*) |
---|
1112 | FROM LabeledExtractData le |
---|
1113 | WHERE le.parent = :extract |
---|
1114 | </sql> |
---|
1115 | <description> |
---|
1116 | A Hibernate query that counts the number of labeled extracts |
---|
1117 | created from a given extract. |
---|
1118 | </description> |
---|
1119 | </query> |
---|
1120 | |
---|
1121 | <query id="COUNT_LABELED_EXTRACTS_FOR_LABEL" type="HQL"> |
---|
1122 | <sql> |
---|
1123 | SELECT count(*) |
---|
1124 | FROM LabeledExtractData le |
---|
1125 | WHERE le.label = :label |
---|
1126 | </sql> |
---|
1127 | <description> |
---|
1128 | A Hibernate query that counts the number of labeled extracts |
---|
1129 | with the given label. |
---|
1130 | </description> |
---|
1131 | </query> |
---|
1132 | |
---|
1133 | <query id="COUNT_SOURCEEVENTS_FOR_BIOMATERIAL" type="HQL"> |
---|
1134 | <sql> |
---|
1135 | SELECT count(*) |
---|
1136 | FROM BioMaterialEventData bme |
---|
1137 | JOIN bme.sources src |
---|
1138 | WHERE index(src) = :bioMaterial |
---|
1139 | </sql> |
---|
1140 | <description> |
---|
1141 | A Hibernate query that counts the number of events a given |
---|
1142 | biomaterial has been part of as a source biomaterial, ie. the number |
---|
1143 | of pooled biomaterials that have been created from it. |
---|
1144 | </description> |
---|
1145 | </query> |
---|
1146 | |
---|
1147 | <query id="GET_CREATION_EVENT_FOR_BIOMATERIAL" type="HQL"> |
---|
1148 | <sql> |
---|
1149 | SELECT evt |
---|
1150 | FROM BioMaterialEventData evt |
---|
1151 | WHERE evt.bioMaterial = :bioMaterial |
---|
1152 | AND evt.eventType = 1 |
---|
1153 | </sql> |
---|
1154 | <description> |
---|
1155 | A Hibernate query that returns the creation event for |
---|
1156 | a biomaterial. |
---|
1157 | </description> |
---|
1158 | </query> |
---|
1159 | |
---|
1160 | <query id="COUNT_UNREAD_MESSAGES_FOR_USER" type="HQL"> |
---|
1161 | <sql> |
---|
1162 | SELECT count(*) |
---|
1163 | FROM MessageData msg |
---|
1164 | WHERE msg.to = :user AND msg.read = false AND msg.removed = false |
---|
1165 | </sql> |
---|
1166 | <description> |
---|
1167 | A Hibernate query that counts the number of |
---|
1168 | unread messages for a given user |
---|
1169 | </description> |
---|
1170 | </query> |
---|
1171 | |
---|
1172 | <query id="COUNT_PLUGINCONFIGURATIONS_FOR_PLUGINDEFINITION" type="HQL"> |
---|
1173 | <sql> |
---|
1174 | SELECT count(*) |
---|
1175 | FROM PluginConfigurationData pc |
---|
1176 | WHERE pc.pluginDefinition = :pluginDefinition |
---|
1177 | </sql> |
---|
1178 | <description> |
---|
1179 | A Hibernate query that counts the number of plugin configurations |
---|
1180 | using a plugin definition. |
---|
1181 | </description> |
---|
1182 | </query> |
---|
1183 | |
---|
1184 | <query id="COUNT_JOBS_FOR_PLUGINCONFIGURATION" type="HQL"> |
---|
1185 | <sql> |
---|
1186 | SELECT count(*) |
---|
1187 | FROM JobData j |
---|
1188 | WHERE j.pluginConfiguration = :pluginConfiguration |
---|
1189 | </sql> |
---|
1190 | <description> |
---|
1191 | A Hibernate query that counts the number of jobs |
---|
1192 | using a plugin configuration. |
---|
1193 | </description> |
---|
1194 | </query> |
---|
1195 | |
---|
1196 | <query id="FIND_JOBS_IN_QUEUE" type="HQL"> |
---|
1197 | <sql> |
---|
1198 | SELECT job |
---|
1199 | FROM JobData job |
---|
1200 | WHERE job.status = :status |
---|
1201 | AND job.type = :type |
---|
1202 | ORDER BY job.priority ASC, job.created ASC |
---|
1203 | </sql> |
---|
1204 | <description> |
---|
1205 | A Hibernate query that loads plugin jobs in the job queue waiting to be |
---|
1206 | executed sorted by priority and waiting type. |
---|
1207 | </description> |
---|
1208 | </query> |
---|
1209 | |
---|
1210 | <query id="GET_PLUGINTYPE_FOR_INTERFACENAME" type="HQL"> |
---|
1211 | <sql> |
---|
1212 | SELECT plt |
---|
1213 | FROM PluginTypeData plt |
---|
1214 | WHERE plt.interfaceName = :interfaceName |
---|
1215 | </sql> |
---|
1216 | <description> |
---|
1217 | Load a plugin type when you know the interface name. |
---|
1218 | </description> |
---|
1219 | </query> |
---|
1220 | |
---|
1221 | <query id="GET_PLUGINDEFINITION_FOR_CLASSNAME" type="HQL"> |
---|
1222 | <sql> |
---|
1223 | SELECT pd |
---|
1224 | FROM PluginDefinitionData pd |
---|
1225 | WHERE pd.className = :className |
---|
1226 | </sql> |
---|
1227 | <description> |
---|
1228 | Load a plugin definition when you know the class name. |
---|
1229 | </description> |
---|
1230 | </query> |
---|
1231 | |
---|
1232 | <query id="LOAD_CONTEXT_NAMES" type="HQL"> |
---|
1233 | <sql> |
---|
1234 | SELECT ctx.id, ctx.name |
---|
1235 | FROM ContextData ctx |
---|
1236 | WHERE ctx.client = :client AND |
---|
1237 | (ctx.user = :user OR ctx.public = true) |
---|
1238 | AND ctx.itemType = :itemType |
---|
1239 | AND ctx.subContext = :subContext |
---|
1240 | ORDER BY ctx.name |
---|
1241 | </sql> |
---|
1242 | <description> |
---|
1243 | A Hibernate query that selects the id and name of all contexts for |
---|
1244 | a user and item type. The names should be sorted in ascending order. |
---|
1245 | </description> |
---|
1246 | </query> |
---|
1247 | |
---|
1248 | <query id="LOAD_CONTEXT_BY_NAME" type="HQL"> |
---|
1249 | <sql> |
---|
1250 | SELECT ctx |
---|
1251 | FROM ContextData ctx |
---|
1252 | WHERE ctx.user = :user |
---|
1253 | AND ctx.client = :client |
---|
1254 | AND ctx.itemType = :itemType |
---|
1255 | AND ctx.subContext = :subContext |
---|
1256 | AND ctx.name = :name |
---|
1257 | </sql> |
---|
1258 | <description> |
---|
1259 | A Hibernate query that load a context given the user, client, |
---|
1260 | item type, subcontext and name of the context. |
---|
1261 | </description> |
---|
1262 | </query> |
---|
1263 | |
---|
1264 | <query id="COUNT_PLUGINS_BY_TYPE_FOR_CONTEXT" type="HQL"> |
---|
1265 | <sql> |
---|
1266 | SELECT plg.mainType, count(*) |
---|
1267 | FROM PluginDefinitionData plg |
---|
1268 | JOIN plg.guiContexts gcx |
---|
1269 | WHERE gcx.itemType = :itemType AND gcx.contextType = :contextType |
---|
1270 | GROUP BY plg.mainType |
---|
1271 | </sql> |
---|
1272 | <description> |
---|
1273 | A Hibernate query that counts the number of |
---|
1274 | plugins available for a given GUI context grouped by |
---|
1275 | the main type of the plugins. |
---|
1276 | </description> |
---|
1277 | </query> |
---|
1278 | |
---|
1279 | <query id="GET_SCHEMA_VERSION" type="HQL"> |
---|
1280 | <sql> |
---|
1281 | SELECT sv |
---|
1282 | FROM SchemaVersionData sv |
---|
1283 | </sql> |
---|
1284 | <description> |
---|
1285 | A Hibernate query that loads the schema version (there should only be one record). |
---|
1286 | </description> |
---|
1287 | </query> |
---|
1288 | |
---|
1289 | <query id="SET_SCHEMA_VERSION" type="HQL"> |
---|
1290 | <sql> |
---|
1291 | UPDATE SchemaVersionData sv |
---|
1292 | SET sv.schemaVersion = :schemaVersion, |
---|
1293 | sv.build = :build |
---|
1294 | </sql> |
---|
1295 | <description> |
---|
1296 | A Hibernate query that updates the schema version and build number. |
---|
1297 | </description> |
---|
1298 | </query> |
---|
1299 | |
---|
1300 | <query id="SET_PROJECT_TYPE" type="HQL"> |
---|
1301 | <sql> |
---|
1302 | UPDATE ProjectData pd |
---|
1303 | SET pd.projectType = 0 |
---|
1304 | WHERE pd.projectType IS NULL |
---|
1305 | </sql> |
---|
1306 | <description> |
---|
1307 | A Hibernate query that updates the new column projectType when going from |
---|
1308 | schema 6 to 7 |
---|
1309 | </description> |
---|
1310 | </query> |
---|
1311 | |
---|
1312 | <query id="SET_JOBS_ABORTED_BY_SERVER_SHUTDOWN" type="HQL"> |
---|
1313 | <sql> |
---|
1314 | UPDATE JobData job |
---|
1315 | SET job.statusMessage = :newStatusMessage, |
---|
1316 | job.percentComplete = :newPercentComplete, |
---|
1317 | job.status = :newStatus, |
---|
1318 | job.ended = :newEnded |
---|
1319 | WHERE job.status = :status AND job.type = :type |
---|
1320 | </sql> |
---|
1321 | <description> |
---|
1322 | A Hibernate query that updates job properties. |
---|
1323 | </description> |
---|
1324 | </query> |
---|
1325 | |
---|
1326 | <query id="FIND_PENDING_JOBS" type="HQL"> |
---|
1327 | <sql> |
---|
1328 | SELECT job |
---|
1329 | FROM JobData job |
---|
1330 | WHERE job.type = :type AND job.ended = null |
---|
1331 | ORDER BY job.priority ASC, job.created ASC |
---|
1332 | </sql> |
---|
1333 | <description> |
---|
1334 | A Hibernate query that loads pending jobs |
---|
1335 | sorted by priority and creation time. |
---|
1336 | </description> |
---|
1337 | </query> |
---|
1338 | |
---|
1339 | <query id="SET_COMPRESSED_ON_FILES" type="HQL"> |
---|
1340 | <sql> |
---|
1341 | UPDATE FileData f |
---|
1342 | SET |
---|
1343 | f.compressed = false, |
---|
1344 | f.compressedSize = f.size |
---|
1345 | WHERE f.compressed IS NULL |
---|
1346 | </sql> |
---|
1347 | <description> |
---|
1348 | A HQL query that sets the compressed property to false and the |
---|
1349 | compressedSize to size for all files with a null value. |
---|
1350 | </description> |
---|
1351 | </query> |
---|
1352 | |
---|
1353 | </predefined-queries> |
---|