[MOBY-guts] biomoby commit
Mark Wilkinson
mwilkinson at pub.open-bio.org
Wed Jul 20 17:00:26 UTC 2005
mwilkinson
Wed Jul 20 13:00:26 EDT 2005
Update of /home/repository/moby/moby-live/Perl/MOBY/Adaptor/moby/queryapi
In directory pub.open-bio.org:/tmp/cvs-serv25053/MOBY/Adaptor/moby/queryapi
Modified Files:
mysql.pm
Log Message:
No, they don't have to be hashified at that pont, but the query itself is a two-step process, and the generic query builder can't do joins over multiple tables so we now do two consecutive queries
moby-live/Perl/MOBY/Adaptor/moby/queryapi mysql.pm,1.18,1.19
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/Adaptor/moby/queryapi/mysql.pm,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- /home/repository/moby/moby-live/Perl/MOBY/Adaptor/moby/queryapi/mysql.pm 2005/07/19 23:47:26 1.18
+++ /home/repository/moby/moby-live/Perl/MOBY/Adaptor/moby/queryapi/mysql.pm 2005/07/20 17:00:26 1.19
@@ -592,8 +592,16 @@
# selects all the columns from service_instance table
# where is lsid?
sub query_service_instance {
- my ($self, @args) = @_;
+ my ($self, %args) = @_;
my $dbh = $self->dbh;
+
+ my $servicename = $args{'servicename'};
+ my $authURI = $args{'authority_uri'};
+
+ my $result = $self->query_authority({authority_uri => $authURI});
+ return [{}] unless @$result[0];
+ my $id = @$result[0]->{authority_id};
+ return [{}] unless $id;
my $statement = "select
service_instance_id,
@@ -608,15 +616,10 @@
signatureURL,
lsid
from service_instance ";
- my @bindvalues = ();
-
- if (@args > 0)
- {
- ($statement, @bindvalues) = add_condition($statement, @args);
- }
-
- my $result = do_query($dbh, $statement, @bindvalues);
- return $result;
+ my @bindvalues;
+ ($statement, @bindvalues) = add_condition($statement, ({servicename => $servicename},"and",{authority_id=>$id}));
+ my $final = do_query($dbh, $statement, @bindvalues);
+ return $final;
}
# custom query for Moby::Central.pm->findService()
More information about the MOBY-guts
mailing list