[ome-devel] findObject wierdness.

Ilya Goldberg igg at nih.gov
Sat Jun 10 03:54:09 BST 2006


On Jun 7, 2006, at 7:18 PM, august wrote:

>
> ok,  please let me know if I am barking up the wrong bush, but I'm
> having a slight handicap in understanding something which should
> probably be more obvious.
>
> The following two queries should be equivilant for the data I have:
>
> my @layers = $factory->findAttributes ("ImageRetinalLayers", {
> 		'TopLayer.Order' =>  ['>=', 3],
> 		'BottomLayer.Order' => ['<=', 7]
> 		}) ;
>
> my @layers = $factory->findAttributes ("ImageRetinalLayers", {
> 	'TopLayer.Order' =>   [ 'in', [3,4,5,6,7]],
> 	'BottomLayer.Order' =>  [ 'in', [3,4,5,6,7]]
> 	}) ;
>
> However I get almost all of the attributes for the first query.  The
> second query does indeed give me the proper results of TopLayer >=  
> 3 and
> BottomLayer <= 7
>
> Any ideas why this is?

It certainly seems like these should be the same.  My guess is that  
this is caused by how table aliasing works in the two joins that  
you're making to the same table.

> Is there a way to see the SQL query that is
> made?

You have to set $SHOW_SQL to 1 in src/perl2/DBObject.pm (line 176 on  
CVS), and the SQL will be reported on stderr.
Make sure you have the src/perl2 directory in your PERL5LIB  
environment variable if you're editing packages in-place.
You probably want to do this in a sand-box consisting of the two  
queries above, otherwise you'll get more SQL than you can shake a  
stick at.
-I

> TopLayer and BottomLayer Attributes refer to a LayerType Attribute
> that looks like this:
>
>  attribute_id | order | name | me_id |          longname
> --------------+-------+------+--------------------- 
> +-----------------------------
>       3984935 |     0 | RPE  | 106697 | Retinal PigmentEphithelium
>       3984936 |     1 | OS   | 106697 | Outer Segment
>       3984937 |     2 | IS   | 106697 | Inner Segment
>       3984938 |     3 | SRS  | 106697 | Subretinal Scar
>       3984939 |     4 | ONL  | 106697 | Outer Nuclear Layer
>       3984940 |     5 | OPL  | 106697 | Outer PlexiformLayer
>       3984941 |     6 | INL  | 106697 | Inner Nuclear Layer
>       3984942 |     7 | IPL  | 106697 | Inner PlexiformLayer
>       3984943 |     8 | GCL  | 106697 | Ganglion Cell Layer
>       3984944 |     9 | ONF  | 106697 | Optic Nerve Fiber
>       3984945 |    10 | ERM  | 106697 | Epiretinal membrane
>
> So, TopLayer.Order and BottomLayer.Order point directly to integers  
> 0-10.
>
>
>
> thanks a lot -august.
>
> PS:  Ilya, I will get to the installer issues when I can.  Thanks for
> the help/instructions so far.
>
> -- 
> 	-------------------
> 	http://aug.ment.org
>
> _______________________________________________
> ome-devel mailing list
> ome-devel at lists.openmicroscopy.org.uk
> http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel
>



More information about the ome-devel mailing list