Warning: Can't synchronize with repository "(default)" (/home/git/ome.git does not appear to be a Git repository.). Look in the Trac log for more information.
- Timestamp:
-
03/12/09 15:18:43 (15 years ago)
- Author:
-
jmoore
- Comment:
-
Probably the main difficulty here is the missing backlink in Hibernate from annotations to their annotationLinks. Maybe be necessary to formulate an SQL query which returns the link ids, which are then loaded via Hibernate.
Something like the following:
omero=#
select distinct on (update_id, child) id, owner_id, update_id, parent, child
from imageannotationlink
order by update_id desc, child desc
limit 20;
id | owner_id | update_id | parent | child
-----+----------+-----------+--------+-------
554 | 0 | 7694 | 954 | 455
553 | 0 | 7690 | 953 | 453
552 | 0 | 7687 | 952 | 452
551 | 0 | 7653 | 951 | 451
504 | 0 | 7613 | 904 | 405
503 | 0 | 7609 | 903 | 403
502 | 0 | 7606 | 902 | 402
501 | 0 | 7603 | 901 | 401
453 | 353 | 7288 | 867 | 345
450 | 353 | 7282 | 864 | 344
447 | 353 | 7276 | 863 | 341
446 | 353 | 7271 | 862 | 341
445 | 353 | 7265 | 861 | 340
443 | 353 | 7264 | 859 | 339
438 | 353 | 7255 | 857 | 337
434 | 353 | 7223 | 852 | 334
433 | 353 | 7218 | 851 | 333
429 | 353 | 7191 | 845 | 328
426 | 353 | 6558 | 776 | 325
425 | 353 | 6538 | 774 | 324
(20 rows)
which can be compared to:
omero=#
select id, owner_id, update_id, parent, child
from imageannotationlink
order by update_id desc
limit 20;
id | owner_id | update_id | parent | child
-----+----------+-----------+--------+-------
554 | 0 | 7694 | 954 | 455
553 | 0 | 7690 | 953 | 453
552 | 0 | 7687 | 952 | 452
551 | 0 | 7653 | 951 | 451
504 | 0 | 7613 | 904 | 405
503 | 0 | 7609 | 903 | 403
502 | 0 | 7606 | 902 | 402
501 | 0 | 7603 | 901 | 401
453 | 353 | 7288 | 867 | 345
450 | 353 | 7282 | 864 | 344
451 | 353 | 7282 | 865 | 344
447 | 353 | 7276 | 863 | 341
446 | 353 | 7271 | 862 | 341
445 | 353 | 7265 | 861 | 340
443 | 353 | 7264 | 859 | 339
444 | 353 | 7264 | 860 | 339
442 | 353 | 7264 | 858 | 339
438 | 353 | 7255 | 857 | 337
437 | 353 | 7255 | 856 | 337
434 | 353 | 7223 | 852 | 334
(20 rows)
See: http://www.postgresql.org/docs/7.4/interactive/sql-select.html#SQL-DISTINCT
Legend:
- Unmodified
- Added
- Removed
- Modified
-
v2
|
v3
|
|
3 | 3 | example query for Image only: |
4 | 4 | {{{ |
5 | | "select distinct ial.child from ImageAnnotationLink ial left outer join fetch ial.child join fetch ial.details.creationEvent where ial.child.ns is null order by ial.details.creationEvent desc" |
| 5 | "select distinct ial.child from ImageAnnotationLink ial left outer |
| 6 | join fetch ial.child join fetch ial.details.creationEvent where |
| 7 | ial.child.ns is null order by ial.details.creationEvent desc" |
6 | 8 | }}} |
7 | 9 | |
1.3.13-PRO © 2008-2011
Agilo Software all
rights reserved
(this page was served in: 0.12204 sec.)