From 724bf5be989fe3f75c660e783f8a9bccb420b32d Mon Sep 17 00:00:00 2001
From: Patrick Meidl <pm2@sanger.ac.uk>
Date: Wed, 22 Feb 2006 16:36:06 +0000
Subject: [PATCH] fixed bug storing xrefs

---
 modules/Bio/EnsEMBL/DBSQL/TranslationAdaptor.pm | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/modules/Bio/EnsEMBL/DBSQL/TranslationAdaptor.pm b/modules/Bio/EnsEMBL/DBSQL/TranslationAdaptor.pm
index 3f35259938..853ecf1a98 100644
--- a/modules/Bio/EnsEMBL/DBSQL/TranslationAdaptor.pm
+++ b/modules/Bio/EnsEMBL/DBSQL/TranslationAdaptor.pm
@@ -235,12 +235,15 @@ sub store {
 
   my $transl_dbID = $sth->{'mysql_insertid'};
 
+  $translation->dbID($transl_dbID);
+  $translation->adaptor($self);
+
   #store object xref mappings to translations
 
   my $dbEntryAdaptor = $self->db()->get_DBEntryAdaptor();
   #store each of the xrefs for this translation
   foreach my $dbl ( @{$translation->get_all_DBEntries} ) {
-     $dbEntryAdaptor->store( $dbl, $transl_dbID, "Translation" );
+     $dbEntryAdaptor->store( $dbl, $translation, "Translation" );
   }
 
 
@@ -279,9 +282,6 @@ sub store {
 
   $translation->get_all_Attributes();
 
-  $translation->dbID( $transl_dbID );
-  $translation->adaptor( $self );
-
   # store any translation attributes that are defined
   my $attr_adaptor = $self->db->get_AttributeAdaptor();
   $attr_adaptor->store_on_Translation($translation,
-- 
GitLab