From 0845552ae2844b8ec2846be9c1c0daaae3a6842e Mon Sep 17 00:00:00 2001
From: premanand17 <prem.apa@gmail.com>
Date: Thu, 24 Nov 2016 13:05:06 +0000
Subject: [PATCH] Added abstract method _tables implementation to
 TranslationAdaptor as needed by generic_count in BaseAdaptor - ENSCORESW-1995

---
 modules/Bio/EnsEMBL/DBSQL/TranslationAdaptor.pm | 14 ++++++++++++++
 modules/t/translation.t                         |  3 +++
 2 files changed, 17 insertions(+)

diff --git a/modules/Bio/EnsEMBL/DBSQL/TranslationAdaptor.pm b/modules/Bio/EnsEMBL/DBSQL/TranslationAdaptor.pm
index 3870054cf8..3ca3cbef6a 100644
--- a/modules/Bio/EnsEMBL/DBSQL/TranslationAdaptor.pm
+++ b/modules/Bio/EnsEMBL/DBSQL/TranslationAdaptor.pm
@@ -965,4 +965,18 @@ sub fetch_all {
   return \@translations;
 }
 
+
+# _tables
+#  Arg [1]    : none
+#  Description: PROTECTED implementation of superclass abstract method.
+#               Returns the names, aliases of the tables to use for queries.
+#  Returntype : list of listrefs of strings
+#  Exceptions : none
+#  Caller     : internal
+#  Status     : Stable
+
+sub _tables {
+  return (['translation', 'tl']);
+}
+
 1;
diff --git a/modules/t/translation.t b/modules/t/translation.t
index 03343f8fd3..dcf0c394a5 100644
--- a/modules/t/translation.t
+++ b/modules/t/translation.t
@@ -338,4 +338,7 @@ ok(!scalar(@alt_tls));
   $ta->species_id(1);
 }
 
+# Test generic_count(), inherited method from BaseAdaptor
+is($ta->generic_count(), @{$ta->list_dbIDs()}, "Number of features from generic_count is equal to the number of dbIDs from list_dbIDs");
+
 done_testing();
-- 
GitLab