diff --git a/modules/Bio/EnsEMBL/Hive/DBSQL/ObjectAdaptor.pm b/modules/Bio/EnsEMBL/Hive/DBSQL/ObjectAdaptor.pm index 8d14c91b8c6fe8d777c3659390981c7570aa58f1..75c16822a29dd51902097c1538ca81825a392b83 100644 --- a/modules/Bio/EnsEMBL/Hive/DBSQL/ObjectAdaptor.pm +++ b/modules/Bio/EnsEMBL/Hive/DBSQL/ObjectAdaptor.pm @@ -49,9 +49,18 @@ sub object_class { sub slicer { # take a slice of the object (if only we could inline in Perl!) my ($self, $object, $fields) = @_; - my $autoinc_id = $self->autoinc_id(); - - return [ map { ($_ eq $autoinc_id) ? $object->dbID() : $object->$_() } @$fields ]; + my $autoinc_id = $self->autoinc_id(); + my $overflow_limit = $self->overflow_limit(); + + return [ map { ($_ eq $autoinc_id) + ? $object->dbID() + : eval { my $value = $object->$_(); + my $ol = $overflow_limit->{$_}; + (defined($ol) and length($value)>$ol) + ? $self->db->get_AnalysisDataAdaptor()->store_if_needed( $value ) + : $value + } + } @$fields ]; }