Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Libraries

    Object::Relation::Schema 0.1.0

    Download button

    No screenshots available
    Downloads: 286  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Kineticode, Inc. | More programs
    Perl Artistic License / FREE
    October 10th, 2007, 21:05 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    Object::Relation::Schema description

    Object::Relation::Schema is a Object::Relation data store schema generation.

    Object::Relation::Schema is a Object::Relation data store schema generation.

    Synopsis

    use Object::Relation::Schema;
    my $sg = Object::Relation::Schema->new;
    $sg->write_schema($file_name);

    This module generates and outputs to a file the schema information necessary to create a data store for a Object::Relation application.

    Class Interface

    Constructors

    new
    my $sg = Object::Relation::Schema->new($handle_class);

    Creates and returns a new Schema object. This is a factory constructor; it will return the subclass corresponding to the handle class name passed as the sole argument.

    Instance Interface

    Instance Attributes

    classes
    my @classes = $sg->classes;
    $sg->classes(@classes);

    The Object::Relation::Meta::Class objects representing classes loaded by the load_classes() method. The classes will be returned in an order appropriate for satisfying dependencies; that is, classes that depend on other classes will be returned after the classes on which they depend.
    Pass in a list of classes to set them explicitly. Dependency ordering will not be guaranteed after setting the classes, so be sure to pass them in in the order you need them.

    Instance Methods

    load_classes
    $sg->load_classes(@dir);
    $sg->load_classes(@dir, $rule);

    Uses File::Find::Rule to find and load all Perl modules found in the directories specified and their subdirectories, and stores the the Object::Relation::Meta::Class objects for each that inherits from Object::Relation::Base. If the last argument so the method is not a File::Find::Rule object, one will be created that ignores directories named .svn and CVS and loads all files that end in .pm and do not contain "#" in their names. If you need something more strict or lenient, create your own File::Find::Rule object and pass it as the last argument. Use Unix-style directory naming for the directory arguments; load_classes() will automatically convert the them to the appropriate format for the current operating system.

    write_schema
    $sg->write_schema($file_name);
    $sg->write_schema($file_name, %params);

    Writes the data store schema generation code to $file_name. If the file or its directory path don't exist, they will be created. All classes loaded by load_classes() will have their schemas written to the file. The optional hash reference takes a number of possible keys:

    with_obj_rel

    If set to a true value, this parameter causes the Object::Relation framework's class schema and setup code to be written to the file, as well. This is useful for setting up a Object::Relation application with a new database.

    begin_schema
    my $code = $sg->begin_schema;

    Returns any schema code to be output at the beginning of a schema file. Returns undef by default, but subclasses may override it.

    end_schema
    my $code = $sg->end_schema;

    Returns any schema code to be output at the end of a schema file. Returns undef by default, but subclasses may override it.

    setup_code
    my $code = $sg->setup_code;

    Returns any schema code necessary for setting up a data store, such as sequences or database functions. This code will be output by write_schema() before any of the class schema code. Returns undef by default, but subclasses may override it.

    schema_for_class
    my @schema = $sg->schema_for_class($class);

    Returns a list of the schema statements that can be used to build the data store for the class passed as an argument. The class can be either a class name or a Object::Relation::Meta::Class object, but must have been loaded by load_classes(). This method is abstract; it must be implemented by subclasses.

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    Object::Relation data store | schema generation | Perl module | Object::Relation | storage | schema

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM