Skip to content
Snippets Groups Projects
Commit 412da5f6 authored by Leo Gordon's avatar Leo Gordon
Browse files

ObjectAdaptor is now overflow-aware and can store longer blobs transparently

parent 93da7196
No related branches found
No related tags found
No related merge requests found
......@@ -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 ];
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment