Bio::DB::BioSQL::Oracle BasePersistenceAdaptorDriver
SummaryIncluded librariesPackage variablesSynopsisDescriptionGeneral documentationMethods
Toolbar
WebCvs
Summary
Bio::DB::BioSQL::Oracle::BasePersistenceAdaptorDriver - DESCRIPTION of Object
Package variables
Privates (from "my" definitions)
%acronym_map = ( "biodatabase" => "db", "taxon_name" => "tax", "taxon" => "tax", "bioentry" => "ent", "bioentry_relationship" => "enta", "biosequence" => "seq", "dbxref" => "dbx", "bioentry_dbxref" => "dbxenta", "reference" => "ref", "bioentry_reference" => "entrefa", "anncomment" => "cmt", "term" => "trm", "term_dbxref" => "trmdbxa", "term_synonym" => "syn", "ontology" => "ont", "bioentry_qualifier_value" => "enttrma", "seqfeature" => "fea", "seqfeature_relationship" => "feaa", "seqfeature_dbxref" => "dbxfeaa", "location" => "loc", "seqfeature_qualifier_value" => "featrma",)
%slot_attribute_map = ( "taxon_name" => { "parent_taxon" => "tax_oid", }, "taxon" => { "parent_taxon" => "tax_oid", }, "bioentry" => { "bionamespace" => "db_oid", "namespace" => "db_oid", "object" => "obj_ent_oid", "subject" => "subj_ent_oid", "parent" => "obj_ent_oid", "child" => "subj_ent_oid", }, "bioentry_relationship" => { "object" => "obj_ent_oid", "subject" => "subj_ent_oid", "parent" => "obj_ent_oid", "child" => "subj_ent_oid", }, "biosequence" => { "primary_seq" => "ent_oid", "crc" => "crc", }, "reference" => { "medline" => "dbx_oid", "pubmed" => "dbx_oid", }, "term" => { "ontology" => "ont_oid", "subject" => "subj_trm_oid", "predicate" => "pred_trm_oid", "object" => "obj_trm_oid", "primary_tag" => "type_trm_oid", "source_tag" => "source_trm_oid", }, "term_synonym" => { "synonym" => "name", "term" => "trm_oid" }, "term_relationship" => { "subject" => "subj_trm_oid", "predicate" => "pred_trm_oid", "object" => "obj_trm_oid", "ontology" => "ont_oid", }, "term_path" => { "subject" => "subj_trm_oid", "predicate" => "pred_trm_oid", "object" => "obj_trm_oid", "ontology" => "ont_oid", }, "seqfeature" => { "primary_tag" => "type_trm_oid", "source_tag" => "source_trm_oid", "entire_seq" => "ent_oid", "object" => "obj_fea_oid", "subject" => "subj_fea_oid", "parent" => "parent_fea_oid", "child" => "child_feat_oid", }, "seqfeature_relationship" => { "object" => "obj_fea_oid", "subject" => "subj_fea_oid", "parent" => "parent_fea_oid", "child" => "child_fea_oid", }, )
$schema_sequence = "BS_SEQUENCE"
%object_entity_map = ( "Bio::Annotation::Comment" => "anncomment", "Bio::DB::BioSQL::CommentAdaptor" => "anncomment", )
Included modules
Bio::DB::BioSQL::BaseDriver
DBD::Oracle qw ( :ora_types )
Inherit
Bio::DB::BioSQL::BaseDriver
Synopsis
Give standard usage here
Description
Describe the object here
Methods
newDescriptionCode
primary_key_nameDescriptionCode
_build_foreign_key_nameDescriptionCode
sequence_nameDescriptionCode
acronym_mapDescriptionCode
Methods description
newcode    nextTop
 Title   : new
Usage : my $obj = Bio::DB::BioSQL::Oracle::BasePersistenceAdaptorDriver->new();
Function: Builds a new Bio::DB::BioSQL::Oracle::BasePersistenceAdaptorDriver object
Returns : an instance of Bio::DB::BioSQL::Oracle::BasePersistenceAdaptorDriver
Args :
primary_key_namecodeprevnextTop
 Title   : primary_key_name
Usage :
Function: Obtain the name of the primary key attribute for the given
table in the relational schema.
For the oracle implementation, this is always oid (with two exceptions that have a virtual primary key). Example : Returns : The name of the primary key (a string) Args : The name of the table (a string)
_build_foreign_key_namecodeprevnextTop
 Title   : _build_foreign_key_name
Usage :
Function: Build the column name for a foreign key to the given table.
We override this here to obtain the acronym for the table and then append '_oid' to it. Other than that we reuse how the default foreign_key_name() determines the table name. Example : Returns : The name of the foreign key column as a string Args : The table name as a string
sequence_namecodeprevnextTop
 Title   : sequence_name
Usage :
Function: Returns the name of the primary key generator (SQL sequence)
for the given table.
Example : Returns : the name of the sequence (a string) Args : The name of the table.
acronym_mapcodeprevnextTop
 Title   : acronym_map
Usage : $obj->acronym_map($newval)
Function: Get/set the map of table names to acronyms (which the oracle
build consistently uses across the panel).
Example :
Returns : value of acronym_map (a hash ref)
Args : on set, new value (a hash ref or undef, optional)
Methods code
newdescriptionprevnextTop
sub new {
    my($class,@args) = @_;

    my $self = $class->SUPER::new(@args);

    # copy the overriding keys into the slot mapping
my $slotmap = $self->slot_attribute_map(); foreach my $tbl (keys %slot_attribute_map) { foreach my $col (keys %{$slot_attribute_map{$tbl}}) { $slotmap->{$tbl}->{$col} = $slot_attribute_map{$tbl}->{$col}; } } # we need to copy the original mapping for the comment table to anncomment
# (all caused by comment being a reserved word in Oracle)
$slotmap->{"anncomment"} = $slotmap->{"comment"}; # now copy the overriding parts into the object-relational mapping
my $ormap = $self->objrel_map(); foreach my $ent (keys %object_entity_map) { $ormap->{$ent} = $object_entity_map{$ent}; } # initialize our own stuff
$self->acronym_map(\%acronym_map); $self->{'schema_sequence'} = $schema_sequence; # we need to set LongReadLen to prevent truncation errors on LOBs
my ($adp) = $self->_rearrange([qw(ADAPTOR)], @args); if($adp) { my $dbh = $adp->dbh(); # set LongReadLen in the database handle if not set already
if($dbh->{'LongReadLen'} < 0x4000) { # we want at least 16k
$dbh->{'LongReadLen'} = 0x20000; # if we got less we demand 128k
} } else { $self->warn("-adaptor not supplied, unable to set LOB buffer"); } return $self;
}
primary_key_namedescriptionprevnextTop
sub primary_key_name {
    my ($self,$table) = @_;

#################################################################
# use this version if you run the view-based API to the biosql #
# naming convention - in that case foreign key and primary key #
# names are identical to the mysql/Pg version. #
#################################################################
# if($table eq "biosequence") {
# $table = $self->table_name("Bio::BioEntry");
# } elsif($table eq "taxon_name") {
# $table = $self->table_name("TaxonNode");
# }
# return $self->SUPER::primary_key_name($table);
#################################################################
#################################################################
# use this version if you run the alias-based API to the biosql #
# naming convention - in that case foreign key and primary key #
# names are different from the mysql/Pg version #
#################################################################
if($table eq "biosequence") { return $self->foreign_key_name("Bio::BioEntry"); } elsif($table eq "taxon_name") { return $self->foreign_key_name("TaxonNode"); } return "oid"; #################################################################
}
_build_foreign_key_namedescriptionprevnextTop
sub _build_foreign_key_name {
    my $self = shift;
    my $table = shift;

    return $self->acronym_map->{$table} ."_oid";
}
sequence_namedescriptionprevnextTop
sub sequence_name {
    my ($self,$table) = @_;
    return $table . "_pk_seq";
}
acronym_mapdescriptionprevnextTop
sub acronym_map {
    my $self = shift;

    return $self->{'acronym_map'} = shift if @_;
    return $self->{'acronym_map'};
}

1;
}
General documentation
FEEDBACKTop
Mailing ListsTop
User feedback is an integral part of the evolution of this and other
Bioperl modules. Send your comments and suggestions preferably to
the Bioperl mailing list. Your participation is much appreciated.
  bioperl-l@bioperl.org                  - General discussion
http://bioperl.org/wiki/Mailing_lists - About the mailing lists
Support Top
 
Please direct usage questions or support issues to the mailing list:

bioperl-l@bioperl.org

rather than to the module maintainer directly. Many experienced and
reponsive experts will be able look at the problem and quickly
address it. Please include a thorough description of the problem
with code and data examples if at all possible.
Reporting BugsTop
Report bugs to the Bioperl bug tracking system to help us keep track
of the bugs and their resolution. Bug reports can be submitted via
email or the web:
  bioperl-bugs@bioperl.org
http://bugzilla.open-bio.org/
AUTHOR - Hilmar LappTop
Email hlapp at gmx.net
CONTRIBUTORSTop
Additional contributors names and emails here
APPENDIXTop
The rest of the documentation details each of the object methods.
Internal methods are usually preceded with a _